Example #1
0
        public virtual void ChangeState(AbstractState nextState)
        {
            if (_currentState != null)
            {
                _currentState.ExitState();
                _previousState = _currentState;
            }

            _currentState = nextState;
            _currentState.EnterState();

            if (log == true)
            {
                Debug.Log("<color=yellow> Changed to state: </color> <color=cyan>" + _currentState + "</color>");
            }
        }