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/api/Animancer.FSM/IState" Type["StateBehaviour"] class Type type-node Derived0["CreatureState"]-->Type click Derived0 "/animancer/api/Animancer.Examples.StateMachines.Creatures/CreatureState" Derived1["CreatureState"]-->Type click Derived1 "/animancer/api/Animancer.Examples.StateMachines.Brains/CreatureState" Derived2["CreatureState"]-->Type click Derived2 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/CreatureState" Derived3["CreatureState"]-->Type click Derived3 "/animancer/api/Animancer.Examples.StateMachines.Platformer/CreatureState"

Syntax

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

Remarks

Documentation: Finite State Machines

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.