Timeline Mixer Documentation
TimelineMixer.TimelineMixerComponent Class Reference
Inheritance diagram for TimelineMixer.TimelineMixerComponent:
[legend]

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...
 
- Public Member Functions inherited from TimelineMixer.TimelineMixerBase
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< BindingDataCreateBindingGroups (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

- Public Types inherited from TimelineMixer.TimelineMixerBase
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
 
- Protected Member Functions inherited from TimelineMixer.TimelineMixerBase
void FadeTo (BindingData bindingData, float targetWeight, float fadeTime=10f, float startTime=-1, int? loopPlayback=null)
 Playback ///.
 

Member Function Documentation

◆ AddTimeline()

void TimelineMixer.TimelineMixerComponent.AddTimeline ( TimelineAsset  timelineAsset)
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.

Parameters
timelineAssetThe timeline asset to add to the system.

◆ ClearTimelineEvents()

void TimelineMixer.TimelineMixerComponent.ClearTimelineEvents ( TimelineAsset  timelineAsset)
inline

Destroys all events assigned to the timeline. Targeting individual events is not possible.

Parameters
timelineAssetTimeline to remove events on.

◆ CreateBindingGroups()

List< BindingData > TimelineMixer.TimelineMixerComponent.CreateBindingGroups ( HashSet< TimelineAsset >  timelineAssets)
inlineprivate

Creates BindingData objects to hold information about bindings

Parameters
timelineAssetsHashSet of TimelineAssets to be processed, for each TimelineAsset a BindingGroup is created
Returns

◆ Crossfade() [1/2]

void TimelineMixer.TimelineMixerComponent.Crossfade ( string  fadeInTimelineName,
string  fadeOutTimelineName,
float  fadeTime = 1f,
float  startTime = -1f 
)
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

Parameters
fadeInTimelineNameThe name of the timeline to fade in
fadeOutTimelineNameThe name of the timeline to fade out
fadeTimeThe duration of the fade in seconds
startTimeThe time, relative to the timeline to start playing from. If left at the default value this parameter is ignored

◆ Crossfade() [2/2]

void TimelineMixer.TimelineMixerComponent.Crossfade ( TimelineAsset  fadeInAsset,
TimelineAsset  fadeOutAsset = null,
float  fadeTime = 1f,
float  startTime = -1f 
)
inline

Fades in one Timeline and fades out another Timeline at the same rate

Parameters
fadeInAssetThe Timeline to fade in
fadeOutAssetThe Timeline to fade out
fadeTimeThe duration of the fade in seconds
startTimeThe 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

◆ FadeIn() [1/2]

void TimelineMixer.TimelineMixerComponent.FadeIn ( string  timelineAssetName,
float  fadeTime = 1f,
float  startTime = -1f,
int?  loopMode = null 
)
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

Parameters
timelineAssetNameThe name of the timeline to fade in
fadeTimeThe duration of the fade in seconds
startTimeThe time, relative to the timeline to start playing from. If left at the default value this parameter is ignored
loopModeShould the timeline loop? Takes a LoopMode option

◆ FadeIn() [2/2]

void TimelineMixer.TimelineMixerComponent.FadeIn ( TimelineAsset  timelineAsset,
float  fadeTime = 1f,
float  startTime = -1f,
int?  loopMode = null 
)
inline

Fades in a Timeline matching the TimelineAsset passed in

Parameters
timelineAssetThe Timeline to fade in
fadeTimeThe duration of the fade in seconds
startTimeThe time, relative to the timeline to start playing from. If left at the default value this parameter is ignored
loopPlaybackShould the timeline loop? Takes a LoopMode option

◆ FadeOut() [1/2]

void TimelineMixer.TimelineMixerComponent.FadeOut ( string  timelineAssetName,
float  fadeTime = 1f 
)
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

Parameters
timelineAssetNameThe name of the timeline to fade out
fadeTimeThe duration of the fade in seconds
startTimeThe time, relative to the timeline to start playing from. If left at the default value this parameter is ignored
loopModeShould the timeline loop? Takes a LoopMode option

◆ FadeOut() [2/2]

void TimelineMixer.TimelineMixerComponent.FadeOut ( TimelineAsset  timelineAsset,
float  fadeTime = 1f 
)
inline

Fades out a Timeline matching the TimelineAsset passed in

Parameters
timelineAssetThe Timeline to fade out
fadeTimeThe duration of the fade in seconds

◆ FadeTo() [1/2]

void TimelineMixer.TimelineMixerComponent.FadeTo ( string  timelineAssetName,
float  targetWeight,
float  fadeTime = 1f,
float  startTime = -1,
int?  loopMode = null 
)
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

Parameters
timelineAssetNameThe name of the Timeline to operate on
targetWeight0 - 1 float value, allows partial fades
fadeTimeThe duration of the fade in seconds
startTimeThe time, relative to the timeline to start playing from. If left at the default value this parameter is ignored
loopModeShould the timeline loop? Takes a LoopMode option

◆ FadeTo() [2/2]

void TimelineMixer.TimelineMixerComponent.FadeTo ( TimelineAsset  timelineAsset,
float  targetWeight,
float  fadeTime = 1f,
float  startTime = -1,
int?  loopMode = null,
float  easeOut = -1 
)
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

Parameters
timelineAssetThe TimelineAsset to operate on
targetWeight0 - 1 float value, allows a Timeline to be partially faded in
fadeTimeThe duration of the fade in seconds
startTimeThe 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
loopPlaybackShould the timeline loop? Takes a LoopMode option

◆ GetExternalConnectionAnimationNode()

PlayableNode TimelineMixer.TimelineMixerComponent.GetExternalConnectionAnimationNode ( Animator  animator)
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.

Parameters
animator
Returns

◆ GetTimelineWithName()

TimelineAsset TimelineMixer.TimelineMixerComponent.GetTimelineWithName ( string  name)
inlineprivate

Returns a TimelineAsset with the given name, if it exists in the list

Parameters
nameThe name of the Timeline that will be found
Returns

◆ Play() [1/2]

void TimelineMixer.TimelineMixerComponent.Play ( string  timelineAssetName,
float  startTime = -1f,
int?  loopMode = null 
)
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

Parameters
timelineAssetNameThe name of the timeline to play
startTimeThe time, relative to the timeline to start playing from. If left at the default value this parameter is ignored
loopModeShould the timeline loop? Takes a LoopMode option

◆ Play() [2/2]

void TimelineMixer.TimelineMixerComponent.Play ( TimelineAsset  timelineAsset,
float  startTime = -1f,
int?  loopPlayback = null 
)
inline

Plays a Timeline matching the TimelineAsset passed in

Parameters
timelineAssetThe Timeline to play
startTimeThe time, relative to the timeline to start playing from. If left at the default value this parameter is ignored
loopPlaybackShould the timeline loop? Takes a LoopMode option

◆ RemoveDuplicates()

HashSet< TimelineAsset > TimelineMixer.TimelineMixerComponent.RemoveDuplicates ( List< TimelineAsset >  timelineAssets)
inlineprivate

Creates a HashSet of Timeline Assets from the original list, removing any duplicate entries

Parameters
timelineAssets
Returns

◆ SetGraph()

void TimelineMixer.TimelineMixerComponent.SetGraph ( PlayableGraph  playableGraph)
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.

Parameters
playableGraph

◆ SetTimelineEvent()

void TimelineMixer.TimelineMixerComponent.SetTimelineEvent ( TimelineAsset  timelineAsset,
float  time,
Action  eventCallback,
NotificationFlags  notificationFlags = NotificationFlags.Retroactive 
)
inline

Sets an event on the selected TimelineAsset at runtime.

Parameters
timelineAssetThe selected TimelineAsset that will recieve the event.
timeThe time on the timeline for the event to fire.
eventCallback

◆ SoloModeSwitch()

void TimelineMixer.TimelineMixerComponent.SoloModeSwitch ( float  fadeTime = 0f)
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

Parameters
fadeTimeThe time it takes to fade all timelines out in seconds