private void OnTriggerEnter(Collider other) { EnnemiObjective objective = other.gameObject.GetComponent <EnnemiObjective>(); if (objective != null) { controler.changeObjective(other.transform, objective.isMoving); } }
public void chooseRandomObjective() { EnnemiObjective objective = pathFinder.selectRandomObjective(); if (objective != null) { this.target = objective.transform; this.targetCanMove = objective.isMoving; refreshPath(); } }