private void Shoot() { GameObject bulletGO = (GameObject)Instantiate(bulletPrefab, firePoint.position, firePoint.rotation); TankBullet bullet = bulletGO.GetComponent <TankBullet>(); if (bullet != null) { bullet.Seek(target); } }
void Shoot() { GameObject bulletGO = (GameObject)Instantiate(bulletPrefab, firePoint.position, firePoint.rotation); TankBullet bullet = bulletGO.GetComponent <TankBullet>(); if (bullet == null) { return; } bullet.Seek(target); GameManager.instance.soundManager.PlaySound("FuturisticWeaponsSet/hand_gun/shot_hand_gun"); }