示例#1
0
 protected override bool Run(GoapAgent agent)
 {
     if (Move())
     {
         RunOver();
     }
     return(true);
 }
示例#2
0
 public virtual void PlanFailed(HashSet <KeyValuePair <string, object> > goals)
 {
     if (ShowPlanState)
     {
         string str = "<color=red>Plan failed</color>\n";
         str += "[ " + GoapAgent.PrettyGoals(goals) + " ]";
         Debug.Log(str);
     }
 }
示例#3
0
        public virtual void PlanFound(HashSet <KeyValuePair <string, object> > goals, Stack <GoapAction> plan)
        {
            if (ShowPlanState)
            {
                int cost = 0;
                foreach (var action in plan)
                {
                    cost += action.Cost;
                }

                string str = "<color=green>Plan found</color>\n";
                str += "[ " + GoapAgent.PrettyPlan(plan) + " ]";
                str += " --> [ " + GoapAgent.PrettyGoals(goals) + " ]\n";
                str += "cost: " + cost.ToString();
                Debug.Log(str);
            }
        }
示例#4
0
 private void Awake()
 {
     Agent = GetComponent <GoapAgent>();
     Init();
 }
示例#5
0
 protected override bool Exit(GoapAgent agent)
 {
     return(true);
 }
示例#6
0
 public override bool CheckProceduralPrecondition(GoapAgent agent)
 {
     return(DestTarget != null);
 }
示例#7
0
 public GoapPlanner(GoapAgent agent)
 {
     _agent = agent;
 }
示例#8
0
 protected abstract bool Exit(GoapAgent agent);
示例#9
0
 protected abstract bool Run(GoapAgent agent);
示例#10
0
 public abstract bool CheckProceduralPrecondition(GoapAgent agent);//TODO: change to coroutine
 protected abstract bool Enter(GoapAgent agent);
示例#11
0
 //protected abstract void SpecificReset(); // since we have Exit(), it no longer needed
 public abstract bool CheckProceduralPrecondition(GoapAgent agent);//TODO: change to coroutine
示例#12
0
 public bool DoRun(GoapAgent agent)
 {
     return(Run(agent));
 }