Пример #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));
 }