StateMachine<TState>.

StateMachine<TState>.WithDefault Class

Summary

A Animancer.FSM.StateMachine`1 with a Animancer.FSM.StateMachine`1.WithDefault.DefaultState.
Assembly
Animancer.dll
Namespace
Animancer.FSM
Interfaces
Base Types
Derived Types
graph BT Type-->Base0["StateMachine<TState>"] click Base0 "/animancer/api/Animancer.FSM/StateMachine_1" Base0-->Base1["Object"] Type-.->Interface0["IStateMachine"] click Interface0 "/animancer/api/Animancer.FSM/IStateMachine" Type["StateMachine<TState>.WithDefault"] class Type type-node Derived0["CharacterState.StateMachine"]-->Type click Derived0 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/StateMachine"

Syntax

[Serializable]
public class StateMachine<TState>.WithDefault : StateMachine<TState>, IStateMachine

Remarks

See Animancer.FSM.StateMachine`1.WithDefault.InitializeAfterDeserialize if using this class in a serialized field.

Documentation: Default States

Attributes

Type Description
SerializableAttribute

Constructors

Name Summary
WithDefault() Creates a new Animancer.FSM.StateMachine`1.WithDefault.
WithDefault(TState) Creates a new Animancer.FSM.StateMachine`1.WithDefault and sets the Animancer.FSM.StateMachine`1.WithDefault.DefaultState.

Fields

Name Constant Value Summary
ForceSetDefaultState
Calls Animancer.FSM.StateMachine`1.ForceSetState(`0) with the Animancer.FSM.StateMachine`1.WithDefault.DefaultState.

Properties

Name Value Summary
AllowNullStates bool
[Assert-Only] Should the Animancer.FSM.StateMachine`1.CurrentState be allowed to be set to null? Default is false.
Inherited from StateMachine<TState>
CurrentState TState
[UnityEngine.SerializeField] The currently active state.
Inherited from StateMachine<TState>
DefaultState TState
The starting state and main state to return to when nothing else is active.
GUILineCount int
[Editor-Only] The number of standard size lines that Animancer.FSM.StateMachine`1.DoGUI will use.
NextState TState
The Animancer.FSM.StateChange`1.NextState.
Inherited from StateMachine<TState>
PreviousState TState
The Animancer.FSM.StateChange`1.PreviousState.
Inherited from StateMachine<TState>

Methods

Name Value Summary
CanSetState(IList<TState>) TState
Returns the first of the `states` which can currently be entered.
Inherited from StateMachine<TState>
CanSetState(TState) bool
Is it currently possible to enter the specified `state`?
Inherited from StateMachine<TState>
DoGUI() void
[Editor-Only] Draws GUI fields to display the status of this state machine.
Inherited from StateMachine<TState>
DoGUI(Rect) void
[Editor-Only] Draws GUI fields to display the status of this state machine in the given `area`.
ForceSetState(TState) void
Calls Animancer.FSM.IState.OnExitState on the Animancer.FSM.StateMachine`1.CurrentState then changes it to the specified `state` and calls Animancer.FSM.IState.OnEnterState on it.
Inherited from StateMachine<TState>
InitializeAfterDeserialize() void
Call this after deserializing to properly initialize the Animancer.FSM.StateMachine`1.CurrentState.
SetAllowNullStates(bool) void
[Assert-Conditional] Sets Animancer.FSM.StateMachine`1.AllowNullStates.
Inherited from StateMachine<TState>
ToString() string
Returns a string describing the type of this state machine and its Animancer.FSM.StateMachine`1.CurrentState.
Inherited from StateMachine<TState>
TryResetDefaultState() bool
Attempts to enter the Animancer.FSM.StateMachine`1.WithDefault.DefaultState and returns true if successful.
TryResetState(IList<TState>) bool
Attempts to enter any of the specified `states` and returns true if successful.
Inherited from StateMachine<TState>
TryResetState(TState) bool
Attempts to enter the specified `state` and returns true if successful.
Inherited from StateMachine<TState>
TrySetDefaultState() bool
Attempts to enter the Animancer.FSM.StateMachine`1.WithDefault.DefaultState and returns true if successful.
TrySetState(IList<TState>) bool
Attempts to enter any of the specified `states` and returns true if successful.
Inherited from StateMachine<TState>
TrySetState(TState) bool
Attempts to enter the specified `state` and returns true if successful.
Inherited from StateMachine<TState>