public void GotoState(int iKey) { if (_stateTable.ContainsKey(iKey) == true) { if (_currentState != null) { _currentState.OnEnd(_stateTable[iKey]); } myState previousState = _currentState; _currentState = _stateTable[iKey]; // _currentState.nowTime = previousState.nowTime; _currentState.OnBegin(previousState); Debug.Log("넘어가"); } }
public abstract void OnEnd(myState nextState);
public abstract void OnBegin(myState previousState);
public void AddState(int iKey, myState addState) { _stateTable.Add(iKey, addState); addState.SetKey(iKey); }