Example #1
0
 void Awake()
 {
     navAgent             = this.GetComponent <NavMeshAgent>();
     navAgent.destination = waypoints[index].position;
     sight  = this.GetComponent <PlayerInSight>();
     health = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHealth>();
 }
Example #2
0
 void Awake()
 {
     player             = GameObject.FindGameObjectWithTag("Player").transform;
     anim               = this.GetComponent <Animator>();
     nav                = this.GetComponent <NavMeshAgent>();
     sight              = this.GetComponent <PlayerInSight>();
     nav.updateRotation = false;
     deadZone          *= Mathf.Deg2Rad;
 }