Search Unity

Assetbundle fail to load at IOS local

Discussion in 'Asset Bundles' started by Mr-Buck, Feb 8, 2017.

  1. Mr-Buck

    Mr-Buck

    Joined:
    Nov 3, 2015
    Posts:
    21
    Hi

    I'm encounter with some assetbundle problem on IOS device

    I can download my assetbundle file from internet and save it at some local path

    but when I try to load it, it just crash and the App will shut down automatically.

    That's something will not happen in Android

    This also won't happen when I preview in Unity( works fine on Mac and PC).

    here's my ccode :




    IEnumerator DownloadBundle()
    {
    while (!Caching.ready)
    yield return null;
    www = WWW.LoadFromCacheOrDownload(downloadPath, 1);
    yield return www;
    isDownloading = false;

    AssetBundle bundle = www.assetBundle;
    AssetBundleRequest request = bundle.LoadAssetAsync("Car", typeof(GameObject));
    yield return request;

    GameObject obj = request.asset as GameObject;

    bundle.Unload(false);
    www.Dispose();

    Instantiate(obj, transform.position, transform.rotation);
    }

    Is there anything that I do wrong?