Unity has some sort of system in place where if you drag an asset into a object ref, it can instead redirect to a subasset. Example: If you import a texture and then make it a Sprite, the sprite is a subobject, but the texture can now be dragged into serialized sprite fields.
Is it possible to define this for custom asset types? I could see a lot of uses for this! It’s almost like an implicit conversion operator, but for drag and drop into serialized fields.
In my particular case, I’ve made a custom graph tool. The graph save file itself is a scriptable and it has a subasset which is essentially the ‘compiled result’ of that graph. I’d like to be able to just drag the parent graph asset into a field of the result type and have the result get assigned automatically.
I’ve searched through the scripting API, but this is a pretty niche question I have trouble even phrasing so I’m unsure where to look. Sub-assets themselves seem pretty sparsely documented.