Unity3D各平臺(tái)Application.xxxPath的路徑

來源:http://blog.csdn.net/ynnmnm/article/details/52253674

http://www.itdecent.cn/p/bbc2690bce30

Application.dataPath

Application.streamingAssetsPath

Application.persistentDataPath

Application.temporaryCachePath

iOS:

Application.dataPath????????????/var/containers/Bundle/Application/app sandbox/xxx.app/Data

Application.streamingAssetsPath /var/containers/Bundle/Application/app sandbox/test.app/Data/Raw

Application.temporaryCachePath /var/mobile/Containers/Data/Application/app sandbox/Library/Caches

Application.persistentDataPath??/var/mobile/Containers/Data/Application/app sandbox/Documents

Android:

Application.dataPath??????????? /data/app/package name-1/base.apk

Application.streamingAssetsPath jar:file:///data/app/package name-1/base.apk!/assets

Application.temporaryCachePath /storage/emulated/0/Android/data/package name/cache

Application.persistentDataPath?? /storage/emulated/0/Android/data/package name/files

Windows:

Application.dataPath:????????????應(yīng)用的appname_Data/

Application.streamingAssetsPath: 應(yīng)用的appname_Data/StreamingAssets

Application.temporaryCachePath: C:\Users\username\AppData\Local\Temp\company name\product name

Application.persistentDataPath:?? C:\Users\username\AppData\LocalLow\company name\product name

四個(gè)路徑的含義

屬性名稱含義

Application.dataPath此屬性用于返回程序的數(shù)據(jù)文件所在文件夾的路徑

Application.streamingAssetsPath此屬性用于返回流數(shù)據(jù)的緩存目錄,返回路徑為相對(duì)路徑,適合設(shè)置一些外部數(shù)據(jù)文件的路徑。

Application.persistentDataPath此屬性用于返回一個(gè)持久化數(shù)據(jù)存儲(chǔ)目錄的路徑,可以在此路徑下存儲(chǔ)一些持久化的數(shù)據(jù)文件:

Application.temporaryCachePath此屬性用于返回一個(gè)臨時(shí)數(shù)據(jù)的緩存目錄。

Android 平臺(tái)

屬性名稱返回路徑

Application.dataPaht? /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

IOS 平臺(tái)

屬性名稱返回路徑

Application.dataPahtApplication /xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data

Application.streamingAssetsPathApplication/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data/Raw

Application.persistentDataPathApplication/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Documents

Application.temporaryCachePathApplication/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Library/Caches

Unity Editor平臺(tái)

屬性名稱返回路徑

Application.dataPahtApplication(工程目錄)/Assets

Application.streamingAssetsPathApplication(工程目錄)/Assets/StreamingAssets

Application.persistentDataPath系統(tǒng)指定目錄1/工程名

Application.temporaryCachePath系統(tǒng)指定目錄2/工程名

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容