Class TrafficSignalClip
A Timeline clip asset that encodes one traffic-light phase (signal colour, optional flashing, optional countdown display) for playback on a TrafficSignalTrack.
public class TrafficSignalClip : PlayableAsset
Inheritance
Remarks
Timeline integration means intersection phases can be authored and adjusted in the visual editor without writing code — red, yellow, and green phases are laid out as draggable clips and adjusted simply by resizing them. At runtime, each clip creates a TrafficSignalBehavior in the playable graph; the TrafficSignalMixer reads the dominant behaviour each frame and pushes the resolved state to the bound TrafficSignalController.
Fields
IndicateTime
Whether to indicate the remaining time of this clip via the linked value display.
[Tooltip("Whether to indicate the remaining time of this clip via the linked time display.")]
public bool IndicateTime
Field Value
bool
isFlashing
Whether the signal should flash during this clip.
[Tooltip("Whether the signal should flash during this clip.")]
public bool isFlashing
Field Value
bool
signal
The traffic signal state that will be applied during the duration of this clip.
[Tooltip("The traffic signal state to apply while this clip is active.")]
public TrafficSignal signal
Field Value
Methods
CreatePlayable(PlayableGraph, GameObject)
Creates and inject a ScriptPlayable into the timeline. The clip is also injected to the behavior so it can accessed during playback.
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
Parameters
| Name | Type | Description |
|---|---|---|
graph | PlayableGraph | The graph to inject playables into. |
owner | GameObject | The game object which initiated the build. |
Returns
Playable — The playable injected into the graph, or the root playable if multiple playables are injected.