Пример #1
0
 private void DoActions(StateControllerMBBase controller)
 {
     for (int i = 0; i < actions.Length; i++)
     {
         actions[i].Act(controller);
     }
 }
Пример #2
0
        private void CheckTransitions(StateControllerMBBase controller)
        {
            for (int i = 0; i < transitions.Length; i++)
            {
                if (transitions[i].decision == null)
                {
                    Debug.LogError(name + ".transitions[" + i + "].decision is null");
                    continue;
                }
                bool decisionSucceeded = transitions[i].decision.Decide(controller);

                if (decisionSucceeded)
                {
                    controller.TransitionToState(transitions[i].trueState);
                }
                else
                {
                    controller.TransitionToState(transitions[i].falseState);
                }
            }
        }
        public override bool Decide(StateControllerMBBase controller)
        {
            bool countdownElapsed = controller.CheckIfCountDownElapsed(time / (controller.interval + 1.0f));

            return(countdownElapsed);
        }
Пример #4
0
 public abstract void Act(StateControllerMBBase controller);
Пример #5
0
 public void UpdateState(StateControllerMBBase controller)
 {
     DoActions(controller);
     CheckTransitions(controller);
 }
 public override bool Decide(StateControllerMBBase controller)
 {
     return(B);
 }
 public abstract bool Decide(StateControllerMBBase controller);