IStateMachine Interface

Summary

A simple keyless Finite State Machine system.
graph BT Type["IStateMachine"] class Type type-node Implementing0["StateMachine<TState>"]-.->Type click Implementing0 "/animancer/api/Animancer.FSM/StateMachine_1" Implementing1["StateMachine<TKey, TState>"]-.->Type click Implementing1 "/animancer/api/Animancer.FSM/StateMachine_2" Implementing2["CharacterState.StateMachine"]-.->Type click Implementing2 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/StateMachine" Implementing3["StateMachine<TState>.WithDefault"]-.->Type click Implementing3 "/animancer/api/Animancer.FSM/WithDefault" Implementing4["StateMachine<TKey, TState>.WithDefault"]-.->Type click Implementing4 "/animancer/api/Animancer.FSM/WithDefault"

Syntax

public interface IStateMachine

Remarks

Documentation: Finite State Machines

Properties

Name Value Summary
AllowNullStates bool
[Assert-Only] Should the Animancer.FSM.IStateMachine.CurrentState be allowed to be set to null? Default is false.
CurrentState Object
The currently active state.
GUILineCount int
[Editor-Only] The number of standard size lines that Animancer.FSM.IStateMachine.DoGUI will use.
NextState Object
The Animancer.FSM.StateChange`1.NextState.
PreviousState Object
The Animancer.FSM.StateChange`1.PreviousState.

Methods

Name Value Summary
CanSetState(IList) Object
Returns the first of the `states` which can currently be entered.
CanSetState(Object) bool
Is it currently possible to enter the specified `state`?
DoGUI() void
[Editor-Only] Draws GUI fields to display the status of this state machine.
DoGUI(Rect) void
[Editor-Only] Draws GUI fields to display the status of this state machine in the given `area`.
ForceSetState(Object) void
Calls Animancer.FSM.IState.OnExitState on the Animancer.FSM.IStateMachine.CurrentState then changes it to the specified `state` and calls Animancer.FSM.IState.OnEnterState on it.
SetAllowNullStates(bool) void
[Assert-Conditional] Sets Animancer.FSM.IStateMachine.AllowNullStates.
TryResetState(IList) bool
Attempts to enter any of the specified `states` and returns true if successful.
TryResetState(Object) bool
Attempts to enter the specified `state` and returns true if successful.
TrySetState(IList) bool
Attempts to enter any of the specified `states` and returns true if successful.
TrySetState(Object) bool
Attempts to enter the specified `state` and returns true if successful.