Example #1
0
    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> ();
    }
Example #2
0
    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> ();
    }
Example #3
0
 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;
 }
Example #4
0
 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;
 }