コード例 #1
0
 private FSMState GetGoalState(FSMState.FSMStates goalState)
 {
     foreach (FSMState state in states)
     {
         if (state.Type == goalState)
         {
             return(state);
         }
     }
     return(null);
 }
コード例 #2
0
        public void Update(GameTime gameTime)
        {
            if (currentState == null)
            {
                currentState = defaultState;
            }
            if (currentState == null)
            {
                return;
            }

            FSMState.FSMStates goalType = currentState.CheckTransitions();
            ChangeState(goalType);
            currentState.Update(gameTime);
        }
コード例 #3
0
 public UnitFSMState(FSMState.FSMStates type, UnitController controller, GameplayManager gm) : base(type)
 {
     this.controller = controller;
     this.gm         = gm;
 }