Skip to main content

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​

NameTypeDescription
graphPlayableGraphThe Playable Director's graph to inject the mixer into.
goGameObjectThe GameObject that requested the graph.
inputCountintThe 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​

NameTypeDescription
directorPlayableDirectorThe PlayableDirector invoking the preview
driverIPropertyCollectorPropertyCollector used to gather previewable properties
  • Methods
    • CreateTrackMixer(PlayableGraph, GameObject, int)
    • GatherProperties(PlayableDirector, IPropertyCollector)