예제 #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> ();
    }
예제 #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> ();
    }
예제 #3
0
파일: AI.cs 프로젝트: amikus/horror-game
 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;
 }
예제 #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;
 }