コード例 #1
0
        public void ChangeState(IState nextState)
        {
            if (ActiveState != null)
            {
                ActiveState.OnExit();
            }

            nextState.OnStart();
            ActiveState = nextState;

            foreach (ITransition transition in nextState.Transitions)
            {
                transition.InitTransition();
            }
        }