Shoot sound
This commit is contained in:
@@ -16,6 +16,9 @@ public class WeaponManager : MonoBehaviour
|
||||
public PlayerManager player;
|
||||
public bool hit = false;
|
||||
|
||||
public AudioSource audioSource = new AudioSource();
|
||||
public AudioClip shootSound;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@@ -36,6 +39,7 @@ public class WeaponManager : MonoBehaviour
|
||||
if (particleShoot != null && player.ammo > 1)
|
||||
{
|
||||
GameObject shoot = Instantiate(particleShoot, spawnShoot.transform.position, spawnShoot.transform.rotation);
|
||||
audioSource.PlayOneShot(shootSound);
|
||||
player.ammo -= 2;
|
||||
Destroy(shoot, 0.3f);
|
||||
fireTime = fireRate + Time.time;
|
||||
|
Reference in New Issue
Block a user