public void Exit() { if (_stateState != StateState.Running) { return; } _stateState = StateState.Idle; ProcessTransitions(StatePhase.Exit); StateExit(); }
public void Enter() { if (_stateState != StateState.Idle) { return; } _stateState = StateState.Running; ProcessTransitions(StatePhase.Enter); StateEnter(); }
public void SetFunc(StateState state, DeleAction action) { actions[(int)state] = action; }
// public void Enter() // { // Action(StateState.ENTER); // } // // public void Tick() // { // Action(StateState.TICK); // } // // public void Leave() // { // Action(StateState.LEAVE); // } public void Action(StateState state) { DeleAction action = actions[(int)state]; if (action != null) action(); }