Addressables question

Hi , sometimes I use Addressables for speed and better memory management , but I don’t really understand
when I have to release an asset .
E.g If i have to instantiate multiple prefabs and I create a simple scriptable object which have an array of gameobjects which I mark as addressable and I load , after instantiate prefabs , can I release the object or can I release just only after I don’t need prefabs . Thanks for your time .

    private void Test()
    {
        var load = Addressables.LoadAssetAsync<Prefabs>("Objects"); // Prefabs it's a simple scriptable object

        await load.Task; //wait for load

        var objects = load.Result; // get result

        for(int i = 0; i < 5; ++i)
        {
            Instantiate(objects.prefabs[i]); //instantiate prefab
        }

       Addressables.Release(load); // or just after i don't use prefabs anymore 

    }

https://docs.unity3d.com/Packages/com.unity.addressables@1.10/manual/MemoryManagement.html?_ga=2.132047439.138867446.1594050702-368938299.1573664011

1 Like