my HEAD hurts and the SFX is TOO LOUD
This commit is contained in:
parent
a3321d361c
commit
d4ebf0ca61
41 changed files with 1465 additions and 123 deletions
20
Assets/Scripts/Entities/EntityDeathSFX.cs
Normal file
20
Assets/Scripts/Entities/EntityDeathSFX.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class EntityDeathSFX : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private AudioSource AS;
|
||||
|
||||
public void PlaySFX(AudioClip audioToPlay, float volume)
|
||||
{
|
||||
AS.PlayOneShot(audioToPlay, volume);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!AS.isPlaying)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue