コード例 #1
0
        public void ChangeState(FSMState <T, U> NewState)
        {
            PreviousState = CurrentState;

            if (CurrentState != null)
            {
                CurrentState.Exit();
            }

            CurrentState = NewState;

            if (CurrentState != null)
            {
                CurrentState.Enter();
            }
        }
コード例 #2
0
        public void ChangeGlobalState(FSMState <T, U> NewGlobal)
        {
            if (GlobalState == null)
            {
                GlobalState = NewGlobal;
                GlobalState.Enter();
                return;
            }

            GlobalState.Exit();
            GlobalState = NewGlobal;
            if (GlobalState != null)
            {
                GlobalState.Enter();
            }
        }