public void ChangeState(IState1 newState) { Debug.Log("ChangeState"); if (currentState != null) { currentState.Exit(); } previousState = currentState; currentState = newState; currentState.Enter(); Debug.Log(currentState); }
public void ReturnToPreviousState() { currentState = previousState; }