void Awake() { anim = GetComponent <Animator> (); playerAudio = GetComponent <AudioSource> (); playerMovement = GetComponent <PlayerMovement> (); playerShooting = GetComponentInChildren <PlayerShooting> (); playerGhostForm = GetComponent <PlayerGhostForm>(); currentHealth = startingHealth; }
void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform; if (!player) { Debug.Log("Make sure your player is tagged!!"); } playerHealth = player.GetComponent <PlayerHealth> (); playerGhostForm = player.GetComponent <PlayerGhostForm>(); enemyHealth = GetComponent <EnemyHealth> (); nav = GetComponent <UnityEngine.AI.NavMeshAgent> (); anim = GetComponent <Animator>(); }