예제 #1
0
        public override bool PrePerform(GAgent gAgent)
        {
            var herbivore = gAgent as Herbivore;

            if (herbivore.PredatorTargets.Count > 0)
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
        public override bool PrePerform(GAgent gAgent)
        {
            if (gAgent.target != null)
            {
                if (Vector3.Distance(gAgent.transform.position, gAgent.target.position) < 5f)
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #3
0
        public override void RunMainAction(GAgent gAgent)
        {
            Debug.Log("Eating.");

            var data = new GStateData(gAgent.controller, gAgent.agent, gAgent.target.position, gAgent.anim, "idle", 2f);

            gAgent.controller.Activity(data);

            IEatable food = gAgent.target.GetComponent <IEatable>();

            (gAgent as Herbivore).Eater.Eat(food);
        }
예제 #4
0
        public override void RunMainAction(GAgent gAgent)
        {
            Vector3 locationTarget = Vector3.zero;

            locationTarget = AINavigation.RandomNavSphere(gAgent.transform.position, gAgent.ViewSphereRadius + 20, -1, false);

            var data = new GStateData(gAgent.controller, gAgent.agent, locationTarget, gAgent.anim, "walk", 2f);

            Debug.Log("Setting navigation course to: " + locationTarget);
            gAgent.GenerateLocationGizmo(locationTarget);
            gAgent.controller.Move(data);
        }
예제 #5
0
        public override void RunMainAction(GAgent gAgent)
        {
            var herbivore = gAgent as Herbivore;

            Debug.Log("Resting.");

            var data = new GStateData(gAgent.controller, gAgent.agent, gAgent.transform.position, gAgent.anim, "idle", 5f);

            gAgent.controller.Activity(data);

            herbivore.Exhausted.LoseExhaustion(50, true);
        }
        public override bool PrePerform(GAgent gAgent)
        {
            var herbivore = gAgent as Herbivore;

            if (herbivore.FoodTargets.Count > 0)
            {
                gAgent.target = herbivore.FoodTargets[0];
                return(true);
            }

            return(false);
        }
예제 #7
0
 public override bool PostPerform(GAgent gAgent)
 {
     return(true);
 }
예제 #8
0
 public abstract bool PostPerform(GAgent gAgent);
예제 #9
0
 public abstract void RunMainAction(GAgent gAgent);
예제 #10
0
 public abstract bool PrePerform(GAgent gAgent);