Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    175
    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:
    175
    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