1. 程式人生 > >Unity3D-各平臺檔案讀寫操作路徑目錄

Unity3D-各平臺檔案讀寫操作路徑目錄

    public string AssetCachesDir
    {
        get
        {
            string dir = "";
#if UNITY_EDITOR
            dir = Application.dataPath + "Caches/";//路徑:/AssetsCaches/
#elif UNITY_IOS
            dir = Application.temporaryCachePath + "/";//路徑:Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Library/Caches/
#elif UNITY_ANDROID dir = Application.persistentDataPath + "/";//路徑:/data/data/xxx.xxx.xxx/files/ #else dir = Application.streamingAssetsPath + "/";//路徑:/xxx_Data/StreamingAssets/ #endif return dir; } }