void Awake() { shootLine = GetComponent<LineRenderer>(); shootLuz = GetComponent<Light>(); enemy = gameObject.GetComponentInParent<Rigidbody>(); enemyAgent = gameObject.GetComponentInParent<NavMeshAgent>(); droneAlarm = GameObject.FindGameObjectWithTag("Drone").GetComponent<DroneAlarm>(); somDisparo = GameObject.FindGameObjectWithTag("enemy").GetComponent<AudioSource>(); }
void Start () { patrolPointID = 0; player = GameObject.FindGameObjectWithTag("Player"); playerHealth = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerHealth>(); enemyAgent = GetComponent<NavMeshAgent>(); anim = GetComponent<Animator>(); nextPatrolSpot(); droneAlarm = GameObject.FindGameObjectWithTag("Drone").GetComponent<DroneAlarm>(); anim.SetBool("Walk", true); enemyHealth = gameObject.GetComponent<EnemyHealth>(); }