Search Unity

Where to call AssetBundleUnload() in Assetbundle Manager?

Discussion in 'Editor & General Support' started by memetic-arts, Jan 19, 2016.

  1. memetic-arts

    memetic-arts

    Joined:
    Feb 27, 2011
    Posts:
    82
    I've been working with the AssetBundle Manager and the accompanying tutorial, and have moved on to incorporating the code into my own project. I recently ran into the "[bundle] can't be loaded because another AssetBundle with the same files is already loaded." error, which is normally solved by including a "bundle.Unload(false)" statement.

    AssetBundleManager.cs includes several functions for handling unloading of assets and dependencies, that are called from a master function called UnloadAssetBundle(), but this function doesn't seem to be called from this file, or any of the other asset-loader files included with the tutorial project.

    Attempts at calling the function from various spots in the scripts have failed, so any input here would be greatly appreciated. My workaround for now will be to rename the images and export a new set of bundles . . . not a solution, but at least i'll be able to move on . . .

    thanks in advance!
     
    Last edited: Jan 19, 2016
  2. memetic-arts

    memetic-arts

    Joined:
    Feb 27, 2011
    Posts:
    82
    So just to close this out, in case this might help someone out, this inexplicably started working as expected once I duped the project, versioned it off, and started working with the duped version.

    Inserted the call to AssetBundleManager.UnloadAssetBundle(assetBundleName) after instantiating the asset, and voila it worked.
     
unityunity