Appearance
ios
Application.dataPath
-> Application/xx/xxx.app/Data 无访问权限Application.streamingAssetsPath
-> Application/xx/xxx.app/Data/Raw 读取权限(www访问需加前缀 file://)Application.persistentDataPath
-> Application/xx/Documents 读写权限Application.temporaryCachePath
-> Application/xx/Library/Caches 读写权限(此目录中文件会被清理软件删除,不建议做存储用)
android
Application.dataPath
-> /data/app/xx.apk 无访问权限Application.streamingAssetsPath
-> jar:file:///data/app/xx.apk/!/assets 读取权限(www访问不需加前缀 file://)Application.persistentDataPath
-> /data/data/xx/files 读写权限Application.temporaryCachePath
-> /data/data/xx/cache 读写权限(此目录中文件会被清理软件删除,不建议做存储用)
windows
Application.dataPath
-> xx/Assets(项编辑器路径) | xx_Data/(运行程序路径) 可读写Application.streamingAssetsPath
-> xx/Assets/StreamingAssets(编辑器路径) | xx_Data/StreamingAssets/(运行程序路径) 可读写Application.persistentDataPath
-> C:/Users/Hanyi/AppData/LocalLow/DefaultCompany/xx 读写Application.temporaryCachePath
-> C:/Users/Hanyi/AppData/Local/Temp/DefaultCompany/xx
mac
Application.dataPath
-> xx/Assets(项编辑器路径) | /User/Hanyi/xx.app/Contents/(运行程序路径) 可读写Application.streamingAssetsPath
-> xx/Assets/StreamingAssets(编辑器路径) | /User/Hanyi/xx.app/Contents/Resources/Data/StreamingAssets/(运行程序路径) 可读写Application.persistentDataPath
-> /User/Hanyi/Library/Application Support/xxCompany/xx 读写Application.temporaryCachePath
-> /var/folders/xxxxxxxx
说明
关于StreamingAssets目录中文件同步读取(这里指的是非ab文件,ab可使用unity提供的接口读取)
ios:因权限限制,只能使用File.OpenRead(path)读取
android:只能www读取(可自己在java中写方法实现同步读取)