public void OnNotify(BaseGameStateEvent gameEvent)
 {
     if (_soundBank.ContainsKey(gameEvent.GetType()))
     {
         var sound = _soundBank[gameEvent.GetType()];
         sound.Sound.Play(sound.Attributes.Volume, sound.Attributes.Pitch, sound.Attributes.Pan);
     }
 }
Example #2
0
 public void OnNotify(BaseGameStateEvent gameEvent)
 {
     if (_soundBank.ContainsKey(gameEvent.GetType()))
     {
         var sound = _soundBank[gameEvent.GetType()];
         sound.Play();
     }
 }
 internal void RegisterSound(BaseGameStateEvent gameEvent, SoundEffect sound,
                             float volume, float pitch, float pan)
 {
     _soundBank.Add(gameEvent.GetType(), new SoundBankItem(sound, new SoundAttributes(volume, pitch, pan)));
 }
Example #4
0
 public void RegisterSound(BaseGameStateEvent gameEvent, SoundEffect sound)
 {
     _soundBank.Add(gameEvent.GetType(), sound);
 }