Esempio n. 1
0
        public void SwitchState(PawnState state)
        {
            LastState = CurrentState;

            if (LastState)
            {
                LastState.DoEnd();
            }
            CurrentState = state;
            if (CurrentState)
            {
                CurrentState.DoStart();
            }
        }
Esempio n. 2
0
        public void SwitchState(PawnState state)
        {
            if (state == null)
            {
                return;
            }

            if (state != CurrentState)
            {
                LastState = CurrentState;
            }

            if (LastState)
            {
                LastState.DoEnd();
            }
            CurrentState = state;
            if (CurrentState)
            {
                CurrentState.DoStart();
            }
        }