For context, the system I want to make is one that creates/destroys entities and assigns their behaviours on a scripted basis. I would have a scriptableObject bound to a track that defines the parameters of the entity to spawn, and the clips on the track would be commands. References to the instantiated objects would be determined by indexing into a dictionary. The reason I want to do it in this roundabout way is so that the timeline can assign AI behaviour to entities across scenes (and also be able to dynamically handle creation/destruction of said entities). A general idea of what I want to do can be seen in the image I attached.
As far as I can tell using scriptableObjects isn’t the intended use of the binding, but the track binding simply takes a Unity Object, and the processframe functions pass an object for data where it’s up to me to process it, so it should work in theory.
I have a couple questions/issues though:
I want to use Markers to spawn/despawn the entity for that track, with info on how to spawn/despawn them as data on the markers. The issue is that I can’t add any Markers that implement INotification to the track even when the SO implements the receiver interface. I’m assuming this is because the timeline is look for a component on the object with the interface, as opposed to the object itself. Obviously scriptableObjects have no components, so it won’t allow any markers to be placed on the track. The same applies for signals.
I could attach the scriptableObject to the track itself, and bind the created gameobject at runtime when it’s spawned. I would now have a gameobject bound to the track, so it could receive notifications. But this only works after it has been spawned, which won’t work for the ‘create’ marker.
Other potential solutions would be using the timeline markers instead of track markers and have the director gameobject handle it, but it would easily get messy and confusing as to which marker corresponds to which track.
Another solution would be just use a very quick clip to spawn/despawn it, which would work, but it isn’t as clean or user-friendly of a solution as using markers which overlay nicely on top of the track and could have user-defined images for spawn/despawn markers.
I understand this is a pretty niche application of the timeline system. The vast majority of cases you could just bind directly from the scene.
I’m just wondering if there would either be more support for binding scriptableobjects (ability to use Markers on scriptableObject bound tracks), or some way that I could use track Markers before a gameObject is bound to the track (rather, specifically in order to bind an object to the track).
