/// <summary> /// Shoots to enemy. /// </summary> private void Shoot() { GameObject _bullet = Instantiate(bulletPrefab, firePoint.position, firePoint.rotation); BulletController bullet = _bullet.GetComponent <BulletController>(); if (audioType == 1) { int ran = Random.Range(0, 2); if (ran == 0) { mAudioSrc.Play(); } else { mAudioSrc2.Play(); } } if (audioType == 2) { mAudioSrc.Play(); } if (bullet != null) { bullet.ChaseEnemy(target); } }