1. 如果要用 AssetBundle.LoadFromFile 的 API Assetbundle 讀取路徑要改成
string p = Application.dataPath + "!assets";
AssetBundle.LoadFromFile(path + "/" + MyAssetBundle);
2. 如果是讀檔案不能直接使用 File.xxx 系列
要改成用 WWW or UnityWebRequest
var unityWebRequest = UnityWebRequest.Get(Path.Combine(Application.streamingAssetsPath, "MyFile.txt"));
unityWebRequest.SendWebRequest();
while (!unityWebRequest.isDone) { }
string txt = unityWebRequest.downloadHandler.text;
感謝分享
回覆刪除感謝分享
回覆刪除