StateMachine<TKey, TState>.

TrySetState(TKey, TState) Method

Summary

Attempts to enter the specified `state` and returns true if successful.
Assembly
Animancer.dll
Namespace
Animancer.FSM
Containing Type
StateMachine<TKey, TState>

Syntax

public bool TrySetState(TKey key, TState state)

Remarks

This method returns true immediately if the specified `state` is already the Animancer.FSM.StateMachine`1.CurrentState. To allow directly re-entering the same state, use Animancer.FSM.StateMachine`2.TryResetState(`0,`1) instead.

Parameters

Name Type Description
key TKey
state TState

Return Value

Type Description
bool