コード例 #1
0
 void Awake()
 {
     player      = GameObject.FindGameObjectWithTag("Player");
     playHealth  = player.GetComponent <PlayHealth> ();
     enemyHealth = GetComponent <EnemyHealth>();
     anim        = GetComponent <Animator> ();
 }
コード例 #2
0
 void Awake()
 {
     player      = GameObject.FindGameObjectWithTag("Player").transform;
     playHealth  = player.GetComponent <PlayHealth> ();
     enemyHealth = GetComponent <EnemyHealth> ();
     nav         = GetComponent <UnityEngine.AI.NavMeshAgent> ();
 }