Search code examples
unity-game-engineassetbundle

Unable to delete downloaded asset bundles


Currently, I have uploaded collections of my scenes to a server in an asset bundle form. However, I'm unable to to delete the asset bundles that I have downloaded from the game before. I tried using

    WWW www = WWW.LoadFromCacheOrDownload (url, 1);         
    yield return www;
    // Handle error
    if (www.error != null)
    {
        Debug.LogError(www.error);
        yield return true;
    }
    else
    {
        Debug.Log("Loaded");
    }

    AssetBundle assetBundle = www.assetBundle;
    assetBundle.LoadAll ();
    www.assetBundle.Unload (false);
    www.Dispose ();

But I got these errors:

errors screenshot


Solution

  • Caching class is responsible for Unity's download cache, and Caching.CleanCache will help to delete all asset bundles you have downloaded.