void Awake() { player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <PlayerHealth> (); enemyHealth = GetComponent <StarEnemyHealth>(); //anim = GetComponent <Animator> (); }
// Use this for initialization void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent <PlayerHealth> (); starEnemyHealth = GetComponent <StarEnemyHealth> (); nav = GetComponent <NavMeshAgent> (); starEnemyAttack = GetComponent <StarEnemyAttack> (); }