I am working on a UI system and i would like to get the screen from addressables by its type automatiacally. Each screen prefab will have it’s own script attached.
Something like this:
public void OpenScreen();
How can I achieve this?
I am working on a UI system and i would like to get the screen from addressables by its type automatiacally. Each screen prefab will have it’s own script attached.
Something like this:
public void OpenScreen();
How can I achieve this?
I don’t think Addressables has a way to provide that information efficiently out of the box. I would suggest creating your own piece of data (like a text file or scriptable object) at build time that maps the type to an addressable key (like name, guid, or asset reference) and parse that at runtime to get the mapping you need.
Thats correct we do not have locations for the components of a Prefab. Only main asset types are generated in the catalog. You would also need to know its key.
If you install the Addressables samples. We do have a ComponentReference sample. This extends the AssetReference, to basically load the Prefab and do a GetComponent. Again you need to know what the Prefab is, you cannot do a database wide search on the component to find it.