2/07/2014

[Unity] 各平台檔案路徑 Path


Unity 各平台檔案路徑 Path

Application.dataPath
包含遊戲資料文件夾的路徑
只可讀,放置一些資源資料

OSX:       ProjectPath/Assets/
Android:   /data/app/xxx.xxx.xxx-1.apk
iOS:       Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data

Application.persistentDataPath
包含一個永久資料目錄的路徑
可讀可寫,可以放一些存檔文件
OSX:        /Users/username/Library/Caches/com/projcetname
Android:    /data/app/packagename/files
Android外部: /storage/sdcard0/Android/data/app/packagename/files
iOS:        Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Documents

Application.streamingAssetsPath
OSX:         ProjectPath/Assets/StreamingAssets
Android:     jar:/file:///data/app/xxx.xxx.xxx-1.apk!/assets
iOS:         Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data/Raw


Application.temporaryCachePath
OSX:         /var/folders/bv/swq_XXXXXXXXX_XXXXXXXXXXXXXXXX/T/com/projcetname
Android:     /data/data/xxx.xxx.xxx/cache
iOS:         Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Library/Caches

沒有留言:

張貼留言