public void Stop() { if (state == States.Stopped) { AILogger.CreateMessage("Already stopped", agent); } else { state = States.Stopped; stateMachine.Stop(); actionPlan = null; currentAction = null; } }
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); } }