Search Unity

Load and unload multiple assets: How manage assets I dont use anymore?

Discussion in 'Asset Bundles' started by rubenpvargas, Aug 8, 2019.

  1. rubenpvargas

    rubenpvargas

    Joined:
    Jul 18, 2012
    Posts:
    31
    So im ussing an asset bundle to load all my npcs, im not using compression in my bundle so as far as I understand when i load an asset from that bundle only that asset loads.

    What i want to do is only load lets say, npc1, and maybe if i need to npc3. But lets say, later on I need npc2 and npc4, but i don't need the previous loaded ones. Its mobile game so memory its important, but im not sure how to handle this. Should I unload the entire asset bundle and load it again? I have like 80 npcs, so having them all in memory is out of the question.

    Can some one direct me on what to do in this case?

    Thanks in advance and sorry for bad english.
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    223
    What we recommend is to group your npcs into different bundles based on when and how you will need them, then when you no longer need them, unload the bundle using assetBundle.Unload(true).

    Also I suggest looking at the Addressables package as it makes it a lot easier to handle this setup.
     
  3. rubenpvargas

    rubenpvargas

    Joined:
    Jul 18, 2012
    Posts:
    31
    I'm not familiar with addressables, it's a completely different system than assetbundles? If this is the case, you recommend it in this case? Thanks a lot.

    Edit: Nvm, watching the official presentation.
     
    Last edited: Aug 9, 2019