Exemple #1
0
 public void PlaySound(int soundIndex, AudioEffects effect = AudioEffects.None, float volume = 1.0f, bool spamCheck = false)
 {
     if (volume < 0.01f)
     {
         return;
     }
     if (UltimaGameSettings.Audio.SoundOn)
     {
         ASound sound;
         if (_sounds.TryGetValue(soundIndex, out sound))
         {
             sound.Play(true, effect, volume, spamCheck);
         }
         else
         {
             string name;
             byte[] data;
             if (SoundData.TryGetSoundData(soundIndex, out data, out name))
             {
                 sound = new UOSound(name, data);
                 _sounds.Add(soundIndex, sound);
                 sound.Play(true, effect, volume, spamCheck);
             }
         }
     }
 }
 public void PlaySound(int soundIndex)
 {
     if (Settings.Audio.SoundOn)
     {
         ASound sound;
         if (m_Sounds.TryGetValue(soundIndex, out sound))
         {
             sound.Play();
         }
         else
         {
             string name;
             byte[] data;
             if (SoundData.TryGetSoundData(soundIndex, out data, out name))
             {
                 sound = new UOSound(name, data);
                 m_Sounds.Add(soundIndex, sound);
                 sound.Play();
             }
         }
     }
 }