Class TMPTextSwitcherTrack
A custom Timeline track that binds to a TextMeshProUGUI component and plays one or more TMPTextSwitcherClip.
This track creates a mixer of type TMPTextSwitcherMixerBehaviour, which handles blending the visual properties of the bound text (color, font size, and content) across all clips.
public class TMPTextSwitcherTrack : TrackAsset
Inheritance
Methods
CreateTrackMixer(PlayableGraph, GameObject, int)
Called by the Timeline system to create the runtime mixer TMPTextSwitcherMixerBehaviour that evaluates and applies the behavior data defined in each TMPTextSwitcherBehaviour, injected via TMPTextSwitcherClip instances on this track.
The mixer interprets the runtime data (color, font size, and text) and applies the combined result to the bound TextMeshProUGUI component.
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
Parameters
| Name | Type | Description |
|---|---|---|
graph | PlayableGraph | The Playable Director's graph to inject the mixer into. |
go | GameObject | The GameObject that requested the graph. |
inputCount | int | The number of playables from clips that will be inputs to the returned mixer. |
Returns
Playable — A handle to the TMPTextSwitcherMixerBehaviour representing the mixer.
GatherProperties(PlayableDirector, IPropertyCollector)
Gathers serializable properties from the bound TextMeshProUGUI so they can be animated and previewed properly in editor mode.
public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
Parameters
| Name | Type | Description |
|---|---|---|
director | PlayableDirector | The PlayableDirector invoking the preview |
driver | IPropertyCollector | PropertyCollector used to gather previewable properties |