StateBehaviour Class

Summary

Base class for UnityEngine.MonoBehaviour states to be used in a Animancer.FSM.StateMachine`1.
Assembly
Animancer.dll
Namespace
Animancer.FSM
Interfaces
Base Types
  • MonoBehaviour
Derived Types
graph BT Type-->Base0["MonoBehaviour"] Type-.->Interface0["IState"] click Interface0 "/animancer-v7-4/api/Animancer.FSM/IState" Type["StateBehaviour"] class Type type-node Derived0["CharacterState"]-->Type click Derived0 "/animancer-v7-4/api/Animancer.Examples.StateMachines/CharacterState" Derived1["CharacterState"]-->Type click Derived1 "/animancer-v7-4/api/Animancer.Examples.AnimatorControllers.GameKit/CharacterState"

Syntax

[HelpURL(StateExtensions.APIDocumentationURL + nameof(StateBehaviour))]
public abstract class StateBehaviour : MonoBehaviour, IState

Remarks

Documentation: State Types

Attributes

Type Description
HelpURLAttribute

Properties

Name Value Summary
CanEnterState bool
[Animancer.FSM.IState.CanEnterState] Determines whether the Animancer.FSM.StateMachine`1 can enter this state. Always returns true unless overridden.
CanExitState bool
[Animancer.FSM.IState.CanExitState] Determines whether the Animancer.FSM.StateMachine`1 can exit this state. Always returns true unless overridden.

Methods

Name Value Summary
OnEnterState() void
[Animancer.FSM.IState.OnEnterState] Asserts that this component isn't already enabled, then enables it.
OnExitState() void
[Animancer.FSM.IState.OnExitState] Asserts that this component isn't already disabled, then disables it.
OnValidate() void
[Editor-Only] States start disabled and only the current state gets enabled at runtime.