public void EnterState(int stateId) { if (currentState != null && currentState.stateId == stateId) { // çśćç¸ĺ return; } FSMStateBase <T> targetState = stateDic.GetValue(stateId); if (currentState != null) { currentState.Exit(actor); } currentState = targetState; currentState.Enter(actor); }
public void RegisterState(FSMStateBase <T> state) { stateDic.Add(state.stateId, state); }