Unity中的Path对应各平台中的Path

最近使用unity读取各个平台路径,特别对移动平台路径的处理
简直是各种蛋疼 各种坑
在此与大家分享下

IOS:
Application.dataPath : Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data
Application.streamingAssetsPath : Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data/Raw
Application.persistentDataPath : Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Documents
Application.temporaryCachePath : Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Library/Caches
android:
Application.dataPath : /data/app/xxx.xxx.xxx.apk
Application.streamingAssetsPath : jar:file:///data/app/xxx.xxx.xxx.apk/!/assets
Application.persistentDataPath : /data/data/xxx.xxx.xxx/files
Application.temporaryCachePath : /data/data/xxx.xxx.xxx/cache
Windows Web Player:
Application.dataPath : file:///D:/MyGame/ (即导包后保存的文件夹,html文件所在文件夹)
Application.streamingAssetsPath :
Application.persistentDataPath :
Application.temporaryCachePath : 

注意:
Application.persistentDataPath 才是移动端可用的保存生成文件的地方
放到resource中打包后不可以更改了
放到Application .dataPath中移动端是没有访问权限的

猜你喜欢

转载自blog.csdn.net/yinhuaiya/article/details/68925588