Class TimeMachineMixerBehaviour
The TimeMachine mixer is responsible for executing time manipulation actions based on TimeMachineClip on the tracks. It processes the TimeMachineBehaviour data injected from these clips and applies actions such as pausing, jumping to a specific time, or a marker. The weight of each clip influences the decision of which action to apply, where higher weights indicate greater influence:
- For example, if a clip with a "Pause" action has the highest weight, the mixer will pause the playback.
- If multiple clips have equal weights, the mixer may prioritize the action from the clip processed last.
public class TimeMachineMixerBehaviour : PlayableBehaviour
Inheritance
Methods
OnPlayableCreate(Playable)
This function is called when the Playable that owns the PlayableBehaviour is created.
This cache the reference to the playable director owning this mixer.
public override void OnPlayableCreate(Playable playable)
Parameters
| Name | Type | Description |
|---|---|---|
playable | Playable | The Playable that is created. |
PopulateMarkerTimes(IEnumerable<TimelineClip>)
Clears and registers marker labels and their start times from the provided timeline clips into the markerClips dictionary. Only clips with a Marker action are processed. The dictionary will only store the first occurrence of each unique marker label, ensuring efficient access to marker positions and preventing duplicates.
public void PopulateMarkerTimes(IEnumerable<TimelineClip> clips)
Parameters
| Name | Type | Description |
|---|---|---|
clips | IEnumerable<TimelineClip> | The collection of timeline clips to process. |
ProcessFrame(Playable, FrameData, object)
Processes each frame of the Playable, evaluating all input clips and applying their associated actions.
This method checks if each input clip's conditions are met, and then executes the corresponding action once per clip. The actions are:
- Pause: Pauses the Timeline playback.
- JumpToTime: Jumps the Timeline to a specific time, as defined by the clip's settings.
- JumpToMarker: Jumps the Timeline to a specific marker.
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
Parameters
| Name | Type | Description |
|---|---|---|
playable | Playable | The Playable owning the mixer. |
info | FrameData | FrameData containing information about the current frame context. |
playerData | object | User data associated with the ScriptPlayableOutput that initiated the process pass. In this context, it should be null because the TimeMachine track doesn't bind to an object. |