private bool CreatureAtTree(EnvCreatureObject creature) { foreach (GameObject tree in GameObject.FindGameObjectsWithTag("tree")) // could be many trees { if (Vector3.Distance(creature.thisCreature.transform.position, tree.transform.position) < 1f) { return(true); } } return(false); }
public EnvDistanceToOtherCreaturesObject(EnvCreatureObject otherCreature, float distance, float angle) { this.otherCreature = otherCreature; this.distance = distance; this.angle = angle; }
public EnvCreatureAction(CreatureAction action, EnvCreatureObject thisCreature) { this.action = action; creaturePerformingAction = thisCreature; }