StateMachine<TKey, TState>.

StateMachine<TKey, TState>.WithDefault Class

Summary

A Animancer.FSM.StateMachine`2 with a Animancer.FSM.StateMachine`2.WithDefault.DefaultKey.
Assembly
Animancer.dll
Namespace
Animancer.FSM
Interfaces
Base Types
graph BT Type-->Base0["StateMachine<TKey, TState>"] click Base0 "/animancer-v7-4/api/Animancer.FSM/StateMachine_2" Base0-->Base1["StateMachine<TState>"] Base1-->Base2["Object"] Type-.->Interface0["IStateMachine"] click Interface0 "/animancer-v7-4/api/Animancer.FSM/IStateMachine" Type-.->Interface1["IKeyedStateMachine<TKey>"] Type-.->Interface2["IDictionary<TKey, TState>"] Type["StateMachine<TKey, TState>.WithDefault"] class Type type-node

Syntax

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

Remarks

See Animancer.FSM.StateMachine`2.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`2.WithDefault.
WithDefault(TKey) Creates a new Animancer.FSM.StateMachine`2.WithDefault and sets the Animancer.FSM.StateMachine`2.WithDefault.DefaultKey.

Fields

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

Properties

Name Value Summary
Count int
Gets the number of states contained in the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
CurrentKey TKey
The key which identifies the Animancer.FSM.StateMachine`1.CurrentState.
Inherited from StateMachine<TKey, TState>
DefaultKey TKey
The starting state and main state to return to when nothing else is active.
Dictionary IDictionary<TKey, TState>
The collection of states mapped to a particular key.
Inherited from StateMachine<TKey, TState>
GUILineCount int
Keys ICollection<TKey>
Gets an System.Collections.Generic.ICollection`1 containing the keys of the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
NextKey TKey
The Animancer.FSM.KeyChange`1.NextKey.
Inherited from StateMachine<TKey, TState>
PreviousKey TKey
The Animancer.FSM.KeyChange`1.PreviousKey.
Inherited from StateMachine<TKey, TState>
this[TKey] TState
The state registered with the `key` in the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
Values ICollection<TState>
Gets an System.Collections.Generic.ICollection`1 containing the state of the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>

Methods

Name Value Summary
Add(KeyValuePair<TKey, TState>) void
Adds a state to the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
Add(TKey, TState) void
Adds a state to the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
AddRange(TKey[], TState[]) void
Adds the specified `keys` and `states`. Both arrays must be the same size.
Inherited from StateMachine<TKey, TState>
Clear() void
Removes all state from the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
Contains(KeyValuePair<TKey, TState>) bool
Determines whether the Animancer.FSM.StateMachine`2.Dictionary contains a specific value.
Inherited from StateMachine<TKey, TState>
ContainsKey(TKey) bool
Determines whether the Animancer.FSM.StateMachine`2.Dictionary contains a state with the specified `key`.
Inherited from StateMachine<TKey, TState>
CopyTo(KeyValuePair<TKey, TState>[], int) void
Copies the contents of the Animancer.FSM.StateMachine`2.Dictionary to the `array` starting at the `arrayIndex`.
Inherited from StateMachine<TKey, TState>
DoGUI(Rect) void
ForceSetState(TKey) TState
Uses Animancer.FSM.StateMachine`2.ForceSetState(`0,`1) to change to the state registered with the `key`. If nothing is registered, it use null and will throw an exception unless Animancer.FSM.StateMachine`1.AllowNullStates is enabled.
Inherited from StateMachine<TKey, TState>
ForceSetState(TKey, TState) void
Calls Animancer.FSM.IState.OnExitState on the Animancer.FSM.StateMachine`1.CurrentState then changes to the specified `key` and `state` and calls Animancer.FSM.IState.OnEnterState on it.
Inherited from StateMachine<TKey, TState>
GetEnumerator() IEnumerator<KeyValuePair<TKey, TState>>
Returns an enumerator that iterates through the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
GetState(TKey) TState
Returns the state registered with the specified `key`, or null if none is present.
Inherited from StateMachine<TKey, TState>
InitializeAfterDeserialize() void
Remove(KeyValuePair<TKey, TState>) bool
Removes a state from the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
Remove(TKey) bool
Removes a state from the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
SetFakeKey(TKey) void
Sets the Animancer.FSM.StateMachine`2.CurrentKey without changing the Animancer.FSM.StateMachine`1.CurrentState.
Inherited from StateMachine<TKey, TState>
ToString() string
Returns a string describing the type of this state machine and its Animancer.FSM.StateMachine`2.CurrentKey and Animancer.FSM.StateMachine`1.CurrentState.
Inherited from StateMachine<TKey, TState>
TryGetValue(TKey, TState) bool
Gets the state registered with the specified `key` in the Animancer.FSM.StateMachine`2.Dictionary.
Inherited from StateMachine<TKey, TState>
TryResetDefaultState() TState
Attempts to enter the Animancer.FSM.StateMachine`2.WithDefault.DefaultKey and returns true if successful.
TryResetState(TKey) TState
Attempts to enter the state registered with the specified `key` and returns it if successful.
Inherited from StateMachine<TKey, TState>
TryResetState(TKey, TState) bool
Attempts to enter the specified `state` and returns true if successful.
Inherited from StateMachine<TKey, TState>
TrySetDefaultState() TState
Attempts to enter the Animancer.FSM.StateMachine`2.WithDefault.DefaultKey and returns true if successful.
TrySetState(TKey) TState
Attempts to enter the state registered with the specified `key` and returns it if successful.
Inherited from StateMachine<TKey, TState>
TrySetState(TKey, TState) bool
Attempts to enter the specified `state` and returns true if successful.
Inherited from StateMachine<TKey, TState>