I am making my own system which is like Addressables. I am currently working on my own version of AssetReference. I can easily load basic assets by using their GUID’s, but sub-assets dont have them.
In docs it it said addressables are capable of referencing and loading a single sub asset. But Addressables source code is too complicated to read. So maybe anyone here knows?
The sub assets are just all pre-referenced as you can’t load sub-assets at runtime, and they just become part of the lookup key in an AssetReference.
Sub-assets are referenced by their asset guid and the sub-asset name.
In the format “guid[name]”.
E.G 3b617f6c0e3720a4fbc476ee33e2041b[Cylinder]
At runtime addressables loads the asset as an Object[]
which contains the asset and sub-assets. When you request a sub-asset it will iterate through the items and find the first one with a matching type and name. So it is possible that if you have multiple sub-assets with the same name and type it wont work. It is also possible to change the sub-asset name and break the connection. So not as stable as guids.