Exemplo n.º 1
0
    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;
    }
Exemplo n.º 2
0
    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;
    }
Exemplo n.º 3
0
    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;
    }