public void DirectTransition(FSMState targetState) { currentState.Enter(); currentState.Exit(); currentState = targetState; currentState.Enter(); currentState.update(); }
public void Update() { currentState.Enter(); (var isTransition, var targetState) = currentState.CheckConditionTransition(); if (isTransition) { currentState.Exit(); currentState = targetState; currentState.Enter(); } currentState.update(); }