Example:
Game object A holds normal refrence to game object B.
A and B are addressables.
A is loaded by Addressables.LoadAssetAsync() ( B is dependency).
Let’s say i want to unload A by Addressables.Release() but still keep B.
I don’t want to use AssetReference inside A to B because loading is more difficult.
AFAIK this is automatic. Since A depends on B, incrementing/decrementing a reference to A should also increment/decrement a reference to B.
Sorry maybe my question isn’t clear.
After loading A i want to spawn some instances of B by Instantitate(B).
Currently when i unload A with Addresable.Realse(A), all sprites inside B instances are unloaded, so i want to increase explicitly ref count for addressable B.
Use Addressables.InstantiateAsync
I can’t use Addressables.InstantiateAsync on B in this case.
In that case, I think you have to make B its own addressable and instantiate it separately. That way when you load A, it will also load B as a dependency, and when you instantiate B, it will increment its own ref count, so when you unload A, it will decrement B’s ref count but not unload it until you release B.