Exemple #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> ();
    }
    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> ();
    }
Exemple #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;
 }
Exemple #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;
 }