Search Unity

Unload and Reload Catalog, dependencies and bundles at runtime

Discussion in 'Addressables' started by danilonishimura, Jul 29, 2019.

  1. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    70
    Hi there :)

    I'm trying to make an asset viewer, where I say which catalog to load, so I can see the same asset in different versions.

    When you try to load a different catalog with the same assets in different versions, It says it can't load the new bundle because another bundle with the same files is already loaded.

    I'm having a hard time trying to figure out how to unload bundles, catalog and resource locations. Clearing the Addressables.ResourceLocators list doesn't seem to do the trick. Using Addressables.Release removes the instance, but doesn't remove the dependency list or the content catalog. I'm still a bit lost in this and any help would be really appreciated.

    Thanks in advance.
     
  2. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    70
    Well, eventually I figured it out what I did wrong. All async operations (initialization, dependencies, catalogs, instantiations) had to have their OpeartionHandles released. I assumed the handle would have been destroyed when the execution left the scope of the method, which isn't the case, because apparently addressables use their handles to know if objects are in use. Hope this helps someone.
     
  3. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
    It helped me. Thank you very much!
     
  4. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
    I was wrong. Even after releasing the LoadCatalogAsync handle, I can't find any way to unload the previously loaded catalog :(

    We you able to do this in some way?