Exemple #1
0
 void Awake() {
     if (instance)
         Destroy(this);
     else {
         instance = this;
         AudioSource = GetComponent<AudioSource>();
     }
 }
Exemple #2
0
 public void PlayOneShot(SoundEffect sound, float volumeScale = 1)
 {
     SoundEffectSource.PlayOneShot(SoundEffects[sound], volumeScale * 1);
 }