Timeline Mixer Documentation
|
Public Member Functions | |
void | Initialize () |
Allows you to initialize timelinemixercomponent at a time of your choosing if autoinitialize is false. Playback methods will not work if uninitialized. | |
void | SetGraph (PlayableGraph playableGraph) |
The playable graph to use can be set before Initialize is called, useful if you need TimelineMixer to use a specific graph to help integrate it with your custom tool. Do not use a playable directors graph, or any graph that you don't manage the lifecycle for. More... | |
void | AddTimeline (TimelineAsset timelineAsset) |
Timelines can be added to the system at runtime by passing in a timeline asset, but they will have no bindings to start with. You will need to use the RebindTrack method to set your bindings. I haven't included a way to pass a list of bindings, as this could VERY easily lead to mistakes and incorrect bindings. Nobody wants an animation track bound to an audio source. More... | |
void | Play (string timelineAssetName, float startTime=-1f, int? loopMode=null) |
Plays a Timeline from the string name, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method More... | |
void | FadeIn (string timelineAssetName, float fadeTime=1f, float startTime=-1f, int? loopMode=null) |
Fades in a Timeline from the string name, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method More... | |
void | FadeOut (string timelineAssetName, float fadeTime=1f) |
Fades out a Timeline from the string name, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method More... | |
void | Crossfade (string fadeInTimelineName, string fadeOutTimelineName, float fadeTime=1f, float startTime=-1f) |
Fades in one Timeline, and fades out another Timeline at the same rate, does a search for the TimelineAssets from the name passed in, and calls the Timeline as key version of the method More... | |
void | FadeTo (string timelineAssetName, float targetWeight, float fadeTime=1f, float startTime=-1, int? loopMode=null) |
Allows more control than other playback methods, can fade out or in depending on parameter values, and also partially fade in a Timeline, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method More... | |
void | Play (TimelineAsset timelineAsset, float startTime=-1f, int? loopPlayback=null) |
Plays a Timeline matching the TimelineAsset passed in More... | |
void | FadeIn (TimelineAsset timelineAsset, float fadeTime=1f, float startTime=-1f, int? loopMode=null) |
Fades in a Timeline matching the TimelineAsset passed in More... | |
void | FadeOut (TimelineAsset timelineAsset, float fadeTime=1f) |
Fades out a Timeline matching the TimelineAsset passed in More... | |
void | Crossfade (TimelineAsset fadeInAsset, TimelineAsset fadeOutAsset=null, float fadeTime=1f, float startTime=-1f) |
Fades in one Timeline and fades out another Timeline at the same rate More... | |
void | FadeTo (TimelineAsset timelineAsset, float targetWeight, float fadeTime=1f, float startTime=-1, int? loopMode=null, float easeOut=-1) |
Allows more control than other playback methods, can fade out or in depending on parameter values, and also partially fade in a Timeline, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method More... | |
PlayableNode | GetExternalConnectionAnimationNode (Animator animator) |
Find the AnimationMixer node that will allow you to connect your custom animation system or other animation related playables. This is the same AnimationMixer that the AnimatorControllerPlayable connects to. Weights on this mixer are not automatically managed, except for when the AnimatorControllerPlayable is connected. You will need to change weights as needed. More... | |
void | SetTimelineEvent (TimelineAsset timelineAsset, float time, Action eventCallback, NotificationFlags notificationFlags=NotificationFlags.Retroactive) |
Sets an event on the selected TimelineAsset at runtime. More... | |
void | ClearTimelineEvents (TimelineAsset timelineAsset) |
Destroys all events assigned to the timeline. Targeting individual events is not possible. More... | |
![]() | |
void | SetTimeUpdateMode (DirectorUpdateMode mode) |
Change the update mode of the Playable Graph to suit your requirements. More... | |
void | SetSpeed (TimelineAsset timelineAsset, float speed) |
Changes the playback speed of a timeline. More... | |
void | SetTime (TimelineAsset timelineAsset, float time) |
Set the current time of a timeline More... | |
void | SetTimeSmooth (TimelineAsset timelineAsset, float targetTime, float duration, AnimationCurve curve=null, bool pauseOnEnd=false) |
Set a target time for a timeline, which will be reached over X seconds. You can use values higher and lower than the current time to move time back and forward. You can pass in an AnimationCurve to change ease in and out. Do not call this every frame, it should be treated as a one-shot call. | |
void | RebindTrack (TimelineAsset timelineAsset, string trackName, UnityEngine.Object binding) |
Allows you to rebind your timeline tracks at runtime, these changes will not show or be recorded in the PlayableDirector. Be careful with this, it is possible to bind unsupported components. Animation track bound to Audio Source for example. More... | |
Private Member Functions | |
HashSet< TimelineAsset > | RemoveDuplicates (List< TimelineAsset > timelineAssets) |
Creates a HashSet of Timeline Assets from the original list, removing any duplicate entries More... | |
List< BindingData > | CreateBindingGroups (HashSet< TimelineAsset > timelineAssets) |
Creates BindingData objects to hold information about bindings More... | |
TimelineAsset | GetTimelineWithName (string name) |
Returns a TimelineAsset with the given name, if it exists in the list More... | |
void | SoloModeSwitch (float fadeTime=0f) |
When you switch modes at runtime this is called, if the mode is changed to Solo then all but the last used timeline will be faded out More... | |
Additional Inherited Members | |
![]() | |
enum | Mode |
In Solo mode the system will try to keep only one timeline active at one time, Multiple mode (Default) has no restrictions on the amount of timelines active | |
![]() | |
void | FadeTo (BindingData bindingData, float targetWeight, float fadeTime=10f, float startTime=-1, int? loopPlayback=null) |
Playback ///. | |
|
inline |
Timelines can be added to the system at runtime by passing in a timeline asset, but they will have no bindings to start with. You will need to use the RebindTrack method to set your bindings. I haven't included a way to pass a list of bindings, as this could VERY easily lead to mistakes and incorrect bindings. Nobody wants an animation track bound to an audio source.
timelineAsset | The timeline asset to add to the system. |
|
inline |
Destroys all events assigned to the timeline. Targeting individual events is not possible.
timelineAsset | Timeline to remove events on. |
|
inlineprivate |
Creates BindingData objects to hold information about bindings
timelineAssets | HashSet of TimelineAssets to be processed, for each TimelineAsset a BindingGroup is created |
|
inline |
Fades in one Timeline, and fades out another Timeline at the same rate, does a search for the TimelineAssets from the name passed in, and calls the Timeline as key version of the method
fadeInTimelineName | The name of the timeline to fade in |
fadeOutTimelineName | The name of the timeline to fade out |
fadeTime | The duration of the fade in seconds |
startTime | The time, relative to the timeline to start playing from. If left at the default value this parameter is ignored |
|
inline |
Fades in one Timeline and fades out another Timeline at the same rate
fadeInAsset | The Timeline to fade in |
fadeOutAsset | The Timeline to fade out |
fadeTime | The duration of the fade in seconds |
startTime | The time, relative to the timeline to start playing from. Takes effect only on the Timeline fading in. If left at the default value this parameter is ignored |
|
inline |
Fades in a Timeline from the string name, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method
timelineAssetName | The name of the timeline to fade in |
fadeTime | The duration of the fade in seconds |
startTime | The time, relative to the timeline to start playing from. If left at the default value this parameter is ignored |
loopMode | Should the timeline loop? Takes a LoopMode option |
|
inline |
Fades in a Timeline matching the TimelineAsset passed in
timelineAsset | The Timeline to fade in |
fadeTime | The duration of the fade in seconds |
startTime | The time, relative to the timeline to start playing from. If left at the default value this parameter is ignored |
loopPlayback | Should the timeline loop? Takes a LoopMode option |
|
inline |
Fades out a Timeline from the string name, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method
timelineAssetName | The name of the timeline to fade out |
fadeTime | The duration of the fade in seconds |
startTime | The time, relative to the timeline to start playing from. If left at the default value this parameter is ignored |
loopMode | Should the timeline loop? Takes a LoopMode option |
|
inline |
Fades out a Timeline matching the TimelineAsset passed in
timelineAsset | The Timeline to fade out |
fadeTime | The duration of the fade in seconds |
|
inline |
Allows more control than other playback methods, can fade out or in depending on parameter values, and also partially fade in a Timeline, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method
timelineAssetName | The name of the Timeline to operate on |
targetWeight | 0 - 1 float value, allows partial fades |
fadeTime | The duration of the fade in seconds |
startTime | The time, relative to the timeline to start playing from. If left at the default value this parameter is ignored |
loopMode | Should the timeline loop? Takes a LoopMode option |
|
inline |
Allows more control than other playback methods, can fade out or in depending on parameter values, and also partially fade in a Timeline, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method
timelineAsset | The TimelineAsset to operate on |
targetWeight | 0 - 1 float value, allows a Timeline to be partially faded in |
fadeTime | The duration of the fade in seconds |
startTime | The time, relative to the timeline to start playing from. Takes effect only on the Timeline fading in. If left at the default value this parameter is ignored |
loopPlayback | Should the timeline loop? Takes a LoopMode option |
|
inline |
Find the AnimationMixer node that will allow you to connect your custom animation system or other animation related playables. This is the same AnimationMixer that the AnimatorControllerPlayable connects to. Weights on this mixer are not automatically managed, except for when the AnimatorControllerPlayable is connected. You will need to change weights as needed.
animator |
|
inlineprivate |
Returns a TimelineAsset with the given name, if it exists in the list
name | The name of the Timeline that will be found |
|
inline |
Plays a Timeline from the string name, does a search for the TimelineAsset from the name passed in, and calls the Timeline as key version of the method
timelineAssetName | The name of the timeline to play |
startTime | The time, relative to the timeline to start playing from. If left at the default value this parameter is ignored |
loopMode | Should the timeline loop? Takes a LoopMode option |
|
inline |
Plays a Timeline matching the TimelineAsset passed in
timelineAsset | The Timeline to play |
startTime | The time, relative to the timeline to start playing from. If left at the default value this parameter is ignored |
loopPlayback | Should the timeline loop? Takes a LoopMode option |
|
inlineprivate |
Creates a HashSet of Timeline Assets from the original list, removing any duplicate entries
timelineAssets |
|
inline |
The playable graph to use can be set before Initialize is called, useful if you need TimelineMixer to use a specific graph to help integrate it with your custom tool. Do not use a playable directors graph, or any graph that you don't manage the lifecycle for.
playableGraph |
|
inline |
Sets an event on the selected TimelineAsset at runtime.
timelineAsset | The selected TimelineAsset that will recieve the event. |
time | The time on the timeline for the event to fire. |
eventCallback |
|
inlineprivate |
When you switch modes at runtime this is called, if the mode is changed to Solo then all but the last used timeline will be faded out
fadeTime | The time it takes to fade all timelines out in seconds |