protected virtual void Start() { enemyMechs = gameObject.GetComponentInParent <EnemyMechs>(); shooter = transform.root.gameObject; selfTakeDamage = gameObject.GetComponentInParent <TakeDamage>(); threatScript = gameObject.GetComponentInParent <ThreatScript>(); aimingScript = transform.root.Find("hips/Torso/AimPoint").GetComponent <EnemyAiming>(); weaponAudioSource = gameObject.GetComponent <AudioSource>(); }
void Start() { takeDamage = gameObject.GetComponent <TakeDamage>(); threatScript = gameObject.GetComponent <ThreatScript>(); navAgent = gameObject.GetComponent <NavMeshAgent>(); torso = transform.Find("hips/Torso"); targets = threatScript.targets.Where(i => i != null && i != this.gameObject).ToArray(); // Patrol(); }