|
Timeline Mixer Documentation
|
Track processors are executed once per track during the TimelineMixer's setup phase, or when rebinding a track at runtime. They handle the setup of connections to mixers and outputs on the PlayableGraph, and also the disconnection process.
In short, they tell Timeline Mixer what to do with this track, and how to connect it on Timeline mixers PlayableGraph.
Basic knowledge of the Unity Playables API is recommended before proceeding with this section. The code examples are heavily commented, but reviewing Unitys Playables documentation will make this easier to understand.
Let's look at the Playable Graph generated by the SignalTrackProcessor:
Track processors manage the section highlighted in red. They connect the Timeline to any required mixer and other playables, and then to the output (which is bound to your component).
In signal tracks, this Passthrough playable is not strictly necessary but serves as a good example for creating a custom track processor with your own mixer.
You can customize how the timeline connects to its outputs on the Playable Graph by using a custom Track Processor. If your custom track doesn't have a specialized track processor, TimelineMixer will use a default one.
To create one, follow these steps:
Here's an example, this is the LightControlTrackProcessor included with the TimelineMixer package:
This example would make a track processor that is applied to a custom timeline track called LightControlTrack.
Track processors are discovered automatically at runtime through reflection
PlayableNode provides a lot of quality of life features, its purpose is to wrap a Playable such as AnimationMixerPlayable and track its connections, and make connecting and disconnecting easier.
You can find out what ports on one Playable are connected which ports on another, not an easy task normally.
Instead of directly connecting Playables to each other, wrap them in a PlayableNode and use that to connect to other PlayableNodes. Doing this tracks all your connections, and makes navigating downstream AND upstream on the graph possible in an easy way.