Search Unity

Unload from memory without calling Resources.UnloadUnusedAssets() ?

Discussion in 'Addressables' started by pep_dj, Nov 16, 2021.

  1. pep_dj

    pep_dj

    Joined:
    Nov 7, 2014
    Posts:
    179
    Addressables are great, but I miss the ability to unload specific assets (after call Addressables.Release method) without calling the generic and slow method Resources.UnloadUnusedAssets. Is there a way to specify the assets to unload, so the call is faster than Resources.UnloadUnusedAssets? Something like Resources.UnloadAsset(assetToUnload)?
     
  2. pep_dj

    pep_dj

    Joined:
    Nov 7, 2014
    Posts:
    179
    I answer myself:

    The problem was that Addressables.Release() was not unloading anything from memory. I realized that it was not releasing anything because there were other addressables in the same group loaded in memory. Now I've created several addressable groups, so when I run Addressables.Release(), and there are no other addressables in the same group loaded in memory, then the resource is unloaded from memory. So, there is no need to call Resources.UnloadUnusedAssets, and that's great! :D