AssetBundle下载崩溃

时间:2018-07-26 10:25:08

标签: unity3d unityscript facebook-unity-sdk

300MB大小的AssetBundleDownload保存到内存后,该时间应用程序在IOS和Andriod Mobile上都崩溃了

 void Save(byte[] data, string path)
    {

        if (!Directory.Exists(Path.GetDirectoryName(path)))
        {
            Directory.CreateDirectory(Path.GetDirectoryName(path));
        }

        try
        {
            File.WriteAllBytes(path, data);  // crash on this line

            Debug.Log("Saved Data to: " + path.Replace("/", "\\"));
        }

        catch (System.Exception e)
        {

            Debug.LogWarning("Failed To Save Data to: " + path.Replace("/", "\\"));
            Debug.LogWarning("Error: " + e.Message);
        }
    }

0 个答案:

没有答案