Search Unity

Question Is It Safe To Call Addressables.Release On Nested Addressable Assets?

Discussion in 'Addressables' started by QuariYune, Nov 25, 2022.

  1. QuariYune

    QuariYune

    Joined:
    Jul 1, 2021
    Posts:
    20
    Lets say I have "character.prefab" in folder A, and "weapon.prefab" in folder B. Different scripts handle the spawning of each, and when "weapon.prefab" is instantiated it is attached as a child somewhere in an instantiated "character.prefab".

    My question then is:
    1. If another script calls Addressables.Release on the instantiated character, will that also properly release (And decrement the count) of Weapons.prefab?

    2. If I made programmatic changes (Swapped sprite, changed hierarchy, released another part of the asset, etc...) will it still property decrement?


    I'm assuming a prefab is just a collection of various assets that the addressables will have packed, and releasing those assets one at a time rather than as a whole (Releasing gameobject) will essentially lead to the same result.

    Thanks!
     
    BVM7797 likes this.