Each of the State types that are included in Animancer has its own Transition type which contains various details relevant to it so that when passed into AnimancerComponent.Play(ITransition)
it will create that type of state. For example, a ClipTransition
will create a ClipState
to play a single AnimationClip
.
Serialized References
Unity's serialization system doesn't normally support inheritance, however the [SerializeReference]
attribute allows it to do so. Placing that attribute on a transition field allows you to choose which type of transition you actually want to use with a dropdown menu in the Inspector without your code needing to know the specific type.
ClipTransition |
ITransition |
---|---|
|
|
This allows you to select ClipTransition or anything that inherits from it such as a ClipTransitionSequence . |
This allows you to select any transition type and is used by Transition Assets. |
The Polymorphic Drawer system also allows you to use this feature on other unrelated types.
Clip Transitions
Type | Details |
---|---|
ClipTransition |
Creates a |
ClipTransitionSequence |
Inherits from |
Mixer Transitions
These transitions create various types of Mixer States. You can Right Click on any of the transition fields to open a context menu with several useful functions.
Type | Details |
---|---|
ManualMixerTransition |
Creates a |
LinearMixerTransition |
Creates a |
MixerTransition2D |
Creates either a |
Other Transitions
Type | Details |
---|---|
ControllerTransition |
Creates a |
PlayableAssetTransition |
Creates a |
Custom Transitions
You can create your own transitions by implementing ITransition
from scratch or inheriting from Transition
or any of its derived types. When doing so, you may also want to alter the way it is drawn in the Inspector by creating another class that inherits from the Drawer
class inside the Transition
you are inheriting from or implementing your own PropertyDrawer
.
The Facial Expressions sample implements a class that inherits from ClipTransition
to add a Name
field to give each transition a user-friendly display name.