Hello!
I’ve been trying to get a GUID of a child asset, and sort of hit a wall. The reason I need this is to be able to save / load an unique id for each asset that never changes. (Unlike instant id).
- AssetDatabase.AssetPathToGUID: requires an asset path, which is the same for both a parent and child asset.
- AssetDatabase.TryGetGUIDAndLocalFileIdentifier: The guid is the same as above, but it also returns a nice local field identifier, which is different for each child asset.
The last one is interesting, since I could just combine the guid and the local file identifier to make a nice unique id. The problem is, there is seemingly no way to do it the other way around, aka use a guid+local file identifier to find an asset.
The only idea I have is to detect that the asset is a child asset, and then manually search for a matching local file identifier every time. Not exactly ideal, but passable if I have a functioning cache.
Any thoughts or ideas?