Ejemplo n.º 1
0
    public void FixedUpdate()
    {
        if (IsTurnedOn)
        {
            if (CurrentlyExecutedCommand == null ||
                CurrentlyExecutedCommand.GoalIsComplete ||
                CurrentlyExecutedCommand.ForcedStop)
            {
                if (CurrentlyExecutedCommand != null)
                {
                    CurrentlyExecutedCommand.StopExecution();
                    CurrentlyExecutedCommand = null;
                }

                if (NextCommands.Count > 0)
                {
                    CurrentlyExecutedCommand = NextCommands.Dequeue();
                    CurrentlyExecutedCommand.StartExecution();
                }
            }
            if (CurrentlyExecutedCommand != null && CurrentlyExecutedCommand.InProgress)
            {
                CurrentlyExecutedCommand.ExecuteFrame();
            }
        }
    }
Ejemplo n.º 2
0
 public void StopAndRemakeOrder()
 {
     NextCommands.Clear();
     CurrentlyExecutedCommand.StopExecution();
     CurrentlyExecutedCommand = null;
     Order_Manager.InstructNavigator(this);
 }