Пример #1
0
 public void Stop()
 {
     if (state == States.Stopped)
     {
         AILogger.CreateMessage("Already stopped", agent);
     }
     else
     {
         state = States.Stopped;
         stateMachine.Stop();
         actionPlan    = null;
         currentAction = null;
     }
 }
Пример #2
0
        private void BeginNextAction()
        {
            if (actionPlan.Count == 0)
            {
                currentAction = null;
                state         = States.Stopped;
                if (OnFinishedPlan != null)
                {
                    OnFinishedPlan();
                }
            }
            else
            {
                state = States.Running;

                currentAction = actionPlan.Dequeue();
                currentAction.Enter(stateMachine, ActionSuccess, ActionFailure);
            }
        }