AnimancerState.

AnimancerState.Transition<TState> Class

Summary

Base class for serializable Animancer.ITransitions which can create a particular type of Animancer.AnimancerState when passed into Animancer.AnimancerPlayable.Play(Animancer.ITransition).
graph BT Type-->Base0["Object"] Type-.->Interface0["ITransitionDetailed"] click Interface0 "/animancer/api/Animancer/ITransitionDetailed" Type-.->Interface1["ITransition"] click Interface1 "/animancer/api/Animancer/ITransition" Type-.->Interface2["IHasKey"] click Interface2 "/animancer/api/Animancer/IHasKey" Type["AnimancerState.Transition<TState>"] class Type type-node Derived0["ManualMixerState.Transition<TMixer>"]-->Type click Derived0 "/animancer/api/Animancer/Transition_1" Derived1["PlayableAssetState.Transition"]-->Type click Derived1 "/animancer/api/Animancer/Transition" Derived2["ControllerState.Transition<TState>"]-->Type click Derived2 "/animancer/api/Animancer/Transition_1" Derived3["ClipState.Transition"]-->Type click Derived3 "/animancer/api/Animancer/Transition"

Syntax

[Serializable]
public abstract class AnimancerState.Transition<TState> : ITransitionDetailed, ITransition, IHasKey 
    where TState : AnimancerState

Remarks

Unfortunately the tool used to generate this documentation does not currently support nested types with identical names, so only one Transition class will actually have a documentation page.

Even though it has the System.SerializableAttribute, this class won't actually get serialized by Unity because it's generic and abstract. Each child class still needs to include the attribute.

Documentation: Transitions

Attributes

Type Description
SerializableAttribute

Type Parameters

Name Description
TState

Properties

Name Value Summary
BaseState AnimancerState
The state that was created by this object. Specifically, this is the state that was most recently passed into Animancer.AnimancerState.Transition`1.Apply(Animancer.AnimancerState) (usually by Animancer.AnimancerPlayable.Play(Animancer.ITransition)).

You can use Animancer.AnimancerPlayable.StateDictionary.GetOrCreate(Animancer.ITransition) or Animancer.AnimancerLayer.GetOrCreateState(Animancer.ITransition) to get or create the state for a specific object.

Animancer.AnimancerState.Transition`1.State is simply a shorthand for casting this to TState.
Events AnimancerEvent.Sequence
[UnityEngine.SerializeField] Events which will be triggered as the animation plays.
FadeDuration float
[UnityEngine.SerializeField] The amount of time the transition will take (in seconds).
FadeMode FadeMode
When a transition is passed into Animancer.AnimancerPlayable.Play(Animancer.ITransition), this property determines which Animancer.FadeMode will be used.
IsLooping bool
[Animancer.ITransitionDetailed] Indicates what the value of Animancer.AnimancerState.IsLooping will be for the created state. Returns false unless overridden.
IsValid bool
Indicates whether this transition can create a valid Animancer.AnimancerState.
Key Object
The Animancer.AnimancerState.Key which the created state will be registered with.

By default, a transition is used as its own Animancer.AnimancerState.Transition`1.Key, but this property can be overridden.
MaximumDuration float
[Animancer.ITransitionDetailed] The maximum amount of time the animation is expected to take (in seconds).
NormalizedStartTime float
[Animancer.ITransitionDetailed] Determines what Animancer.AnimancerState.NormalizedTime to start the animation at. Returns System.Single.NaN unless overridden.
SerializedEvents AnimancerEvent.Sequence.Serializable
[UnityEngine.SerializeField] Events which will be triggered as the animation plays.
Speed float
[Animancer.ITransitionDetailed] Determines how fast the animation plays (1x = normal speed). Returns 1 unless overridden.
State TState
The state that was created by this object. Specifically, this is the state that was most recently passed into Animancer.AnimancerState.Transition`1.Apply(Animancer.AnimancerState) (usually by Animancer.AnimancerPlayable.Play(Animancer.ITransition)).

You can use Animancer.AnimancerPlayable.StateDictionary.GetOrCreate(Animancer.ITransition) or Animancer.AnimancerLayer.GetOrCreateState(Animancer.ITransition) to get or create the state for a specific object.

This property is shorthand for casting the Animancer.AnimancerState.Transition`1.BaseState to TState.

Methods

Name Value Summary
AddItemsToContextMenu(GenericMenu, SerializedProperty, Serialization.PropertyAccessor) void
[Editor-Only] Adds context menu functions for this transition.
Apply(AnimancerState) void
[Animancer.ITransition] Called by Animancer.AnimancerPlayable.Play(Animancer.ITransition) to set the Animancer.AnimancerState.Transition`1.BaseState and apply any other modifications to the `state`.
CreateState() TState
Creates and returns a new TState.

Note that using methods like Animancer.AnimancerPlayable.Play(Animancer.ITransition) will also call Animancer.AnimancerState.Transition`1.Apply(Animancer.AnimancerState), so if you call this method manually you may want to call that method as well. Or you can just use Animancer.AnimancerUtilities.CreateStateAndApply(Animancer.ITransition,Animancer.AnimancerPlayable).