public override bool IsValid(IODAAgent source, IODAAgent target) { //target exists and is a bush if (target == null) return false; Berry b = target.GetComponent<Berry>(); if(b == null) return false; if(distance!= -1 && source.DistanceTo(target) < distance) return true; return false; }
public override bool IsValid(IODAAgent source, IODAAgent target) { //target exists and is a Animal and animal is carnivore if (target == null) return false; AnimalAgent b = target.GetComponent<AnimalAgent>(); if (b == null || !source.GetComponent<AnimalAgent>().IsCarnivore()) return false; //distance to fight if (source.DistanceTo(target) > distance) return false; return true; }
public override bool IsValid(IODAAgent source, IODAAgent target) { //target exists and is a bush if (target == null) return false; CorpseAgent b = target.GetComponent<CorpseAgent>(); if (b == null) return false; if (source.DistanceTo(target) > distance) return false; return true; }