示例#1
0
 public override void PlanFailed(WorldGoal failedGoal)
 {
     // Not handling this here since we are making sure our goals will always
     // succeed.
     // TODO: Make sure the world state has changed before running the same
     //       goal again.
     // TODO: Support multiple goals and select the next one.
 }
示例#2
0
 public override void PlanFailed(WorldGoal failedGoal)
 {
     // If this happens for too long, there is probably a bug in the actions,
     // goals or world setup.
     // TODO: Make sure the world state has changed before running the same
     //       goal again.
     // TODO: Support multiple goals and select the next one.
     textBubble.SetText("...");
 }
示例#3
0
 protected WorldGoal[] GoalsToWorldGoal(Goal[] goals)
 {
     WorldGoal[] worldGoals = new WorldGoal[goals.Length];
     for (int i = 0; i < goals.Length; i++)
     {
         WorldGoal worldGoal = new WorldGoal();
         worldGoal[this] = goals[i];
         worldGoals[i]   = worldGoal;
     }
     return(worldGoals);
 }
示例#4
0
        public override void PlanFailed(WorldGoal failedGoal)
        {
            // If this happens for too long, there is probably a bug in the actions,
            // goals or world setup.
            // TODO: Make sure the world state has changed before running the same
            //       goal again.
            // TODO: Support multiple goals and select the next one.
            toughtBubble.SetActionText("...");
            // Debug messages are called in the planner

            // Allow switching between multiple goals
            goalIndex = (goalIndex + 1) % worldGoals.Length;
        }
示例#5
0
        public override void PlanFound(WorldGoal goal, Queue <ITransition> actions)
        {
            // Yay we found a plan for our goal!
            Debug.Log("<color=green>Plan found</color> " + GoapAgent.PrettyPrint(actions));

            // Once a plan was found we can come back to the main goal
            if (actions.Count > 0)
            {
                goalIndex = 0;
            }
            else
            {
                goalIndex++; // Avoid repeating the main goal once it's solved
            }
        }
示例#6
0
 public override void PlanFound(WorldGoal goal, Queue <ITransition> actions)
 {
     // Yay we found a plan for our goal!
     Debug.Log("<color=green>Plan found</color> " + GoapAgent.PrettyPrint(actions));
 }
示例#7
0
 public override void PlanFound(WorldGoal goal, Queue <GoapAction.WithContext> actions)
 {
     // Yay we found a plan for our goal
     Debug.Log("ok...");
     Debug.Log("<color=green>Plan found</color> " + GoapAgent.PrettyPrint(actions));
 }