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(); } } }
public void StopAndRemakeOrder() { NextCommands.Clear(); CurrentlyExecutedCommand.StopExecution(); CurrentlyExecutedCommand = null; Order_Manager.InstructNavigator(this); }