Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Discussion Addressables for resource management

Discussion in 'Addressables' started by KingoJH, Jan 19, 2023.

  1. KingoJH

    KingoJH

    Joined:
    Nov 6, 2015
    Posts:
    27
    Hey, maybe I am misunderstanding the addressables so I thought I would ask. Hope I'm in the right section! I am creating a map for mobile game which has many different type of assets. A typical mobile progression path in which parts of the map get unlocked and assets added/removed. For example "clean dirt from window". Player has to tap to use or hand in an item to clean it. Then the dirt asset gets removed.

    So I was thinking, a lot of these type of assets are not really needed anymore once a quest is completed. Would addressables be a good way to implement this? Add a script to a gameobject which checks if it's not used elsewhere and deletes it if it's not. Save some of that precious memory space! Would this be possible? I assume with something like this you can't really use a sprite atlas so more draw calls I guess? Maybe this is more of a resources folder thing? I always learned that it's better to avoid the resources folder.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,606
    Best to touch up with the principles of addressables memory management: https://docs.unity3d.com/Packages/com.unity.addressables@1.20/manual/MemoryManagement.html

    Notably:
    Most likely your assets will be part of large groups, meaning they won't be unloaded for memory.

    It's best to think about addressables the other way around: as a way to only load something into memory when needed.
     
  3. KingoJH

    KingoJH

    Joined:
    Nov 6, 2015
    Posts:
    27
    Oh thank you for the link! Will check it out. I also think you are right! With something like this I guess the best approach would be to separate the areas you need to show on the map, also separate the temporary assets per area and load/remove when needed as an addressable.
     
    spiney199 likes this.