After looking into Timeline and the Playables API, I found that the ExposedReference system is a great addition to Unity. The documentation also states, that I could use ExposedReference in a ScriptableObject to reference scene objects.
I know that the system doesn’t automatically handle what I want for me, but I thought that I could build something like the referencing between timelines and the Director component for ScriptableObjects. Here’s what I would imagine:
- I have a field of ExposedReference on my ScriptableObject
- I drag any GO from the scene into it, and it stores some sort of identifier
- The reference notifies some sort of manager component in the scene (like the Director) and saves the actual GameObject reference together with the identifier as a key
- Later, my ScriptableObject can call Resolve() on the manager component to get the actual object back when passing in the stored identifier
In principle, the same as with timeline and from the looks of the documentation I thought, that the provided system would be extendable or help me build something like this. But after trying I noticed, that ExposedReference fields don’t allow scene objects and it looks like I have to recreate the entire system by myself.
If that is the case, why is there even an interface IExposedPropertyTable for the director, if I can’t implement my own version of a resolver? It does imply that I should be able to make use of it. Or am I simply missing something?