Пример #1
0
    private void Replan()
    {
#if UNITY_EDITOR
        System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
        sw.Start();
#endif
        foreach (AIAction action in allActions)
        {
            action.IsActivated = false;
        }
        Plan = planner.CalculatePlan(this, allActions, WorldState, AllGoals, out currentGoal);
#if UNITY_EDITOR
        if (brain.plannerDebug)
        {
            sw.Stop();
            brain.ShowDebugMessage("Planned, Took " + sw.ElapsedMilliseconds + " ms to calculate a plan, Goal is " + currentGoal);
        }
#endif
        //if (Plan == null || Plan.Count == 0)
        //{
        //    Plan = new Queue<AIAction>();
        //    Plan.Enqueue(*Get Default Action*); // it is better to assign a default idle action if you have one
        //}
    }