Archived
Shoot sound
This commit is contained in:
1 parent
d256f7dd45
commit
8d1c4a02c2
2 files changed
+106
No files matched your search
@@ -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