PH.PlayerHealth playerHealth; // Reference to the player's health. #endregion Fields #region Methods void Awake() { // Set up the references. player = GameObject.FindGameObjectWithTag ("Player").transform; playerHealth = player.GetComponent <PH.PlayerHealth> (); enemyHealth = GetComponent <EnemyHealth> (); nav = GetComponent <NavMeshAgent> (); }
NavMeshAgent nav; // Reference to the nav mesh agent. void Awake() { // Set up the references. player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent <PH.PlayerHealth> (); enemyHealth = GetComponent <EnemyHealth> (); nav = GetComponent <NavMeshAgent> (); }
void Awake() { // Set up the references to Unity components player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent<PH.PlayerHealth>(); enemyHealth = GetComponent<EnemyHealth>(); anim = GetComponent<Animator>(); target = player.transform; nav = GetComponent<NavMeshAgent>(); startPosition = transform.position; }
void Awake() { // Set up the references to Unity components player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <PH.PlayerHealth>(); enemyHealth = GetComponent <EnemyHealth>(); anim = GetComponent <Animator>(); target = player.transform; nav = GetComponent <NavMeshAgent>(); startPosition = transform.position; }