Unity 中的各种 Path 在各平台下的对应路径

iOS:

1
2
3
4
Application.dataPath = /var/containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/XXX.app/Data
Application.persistentDataPath = /var/mobile/Containers/Data/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Documents
Application.temporaryCachePath = /var/mobile/Containers/Data/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Library/Caches
Application.streamingAssetsPath = /var/containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/XXX.app/Data/Raw

Android:

1
2
3
4
Application.dataPath = /data/app/xxx.xxx.xxx-1/base.apk
Application.persistentDataPath = /storage/emulated/0/Android/data/xxx.xxx.xxx/files
Application.temporaryCachePath = /storage/emulated/0/Android/data/xxx.xxx.xxx/cache
Application.streamingAssetsPath = jar:file:///data/app/xxx.xxx.xxx-1/base.apk!/assets

Windows:

1
2
3
4
Application.dataPath = ProjectName/Assets
Application.persistentDataPath = C:/Users/UserName/AppData/LocalLow/CompanyName/ProjectName
Application.temporaryCachePath = C:/Users/UserName/AppData/Local/Temp/CompanyName/ProjectName
Application.streamingAssetsPath = ProjectName/Assets/StreamingAssets

Mac:

1
2
3
4
Application.dataPath = ProjectName/Assets
Application.persistentDataPath = /Users/UserName/Library/Application Support/CompanyName/ProjectName
Application.temporaryCachePath = $TMPDIR/CompanyName/ProjectName
Application.streamingAssetsPath = ProjectName/Assets/StreamingAssets