Version: 2020.2
LanguageEnglish
  • C#

AnimatorStateMachine

class in UnityEditor.Animations

/

Inherits from:Object

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A graph controlling the interaction of states. Each state references a motion.

Properties

anyStatePositionThe position of the AnyState node.
anyStateTransitionsThe list of AnyState transitions.
behavioursThe Behaviour list assigned to this state machine.
defaultStateThe state that the state machine will be in when it starts.
entryPositionThe position of the entry node.
entryTransitionsThe list of entry transitions in the state machine.
exitPositionThe position of the exit node.
parentStateMachinePositionThe position of the parent state machine node. Only valid when in a hierachic state machine.
stateMachinesThe list of sub state machines.
statesThe list of states.

Public Methods

AddAnyStateTransitionUtility function to add an AnyState transition to the specified state or statemachine.
AddEntryTransitionUtility function to add an incoming transition to the exit of it's parent state machine.
AddStateUtility function to add a state to the state machine.
AddStateMachineUtility function to add a state machine to the state machine.
AddStateMachineBehaviourAdds a state machine behaviour class of type T to the AnimatorStateMachine. Note that there is no corresponding "Remove" method. To remove a state machine behaviour, use Object.Destroy.
AddStateMachineExitTransitionUtility function to add an outgoing transition from the source state machine to the exit of it's parent state machine.
AddStateMachineTransitionUtility function to add an outgoing transition from the source state machine to the destination.
GetStateMachineTransitionsGets the list of all outgoing state machine transitions from given state machine.
MakeUniqueStateMachineNameMakes a unique state machine name in the context of the parent state machine.
MakeUniqueStateNameMakes a unique state name in the context of the parent state machine.
RemoveAnyStateTransitionUtility function to remove an AnyState transition from the state machine.
RemoveEntryTransitionUtility function to remove an entry transition from the state machine.
RemoveStateUtility function to remove a state from the state machine.
RemoveStateMachineUtility function to remove a state machine from its parent state machine.
RemoveStateMachineTransitionUtility function to remove an outgoing transition from source state machine.
SetStateMachineTransitionsSets the list of all outgoing state machine transitions from given state machine.

Inherited Members

Properties

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Methods

GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the object.

Static Methods

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeGets a list of all loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.