示例#1
0
 public void PlaySound(int soundIndex, AudioEffects effect = AudioEffects.None, float volume = 1.0f, bool spamCheck = false)
 {
     if (volume < 0.01f)
     {
         return;
     }
     if (Settings.Audio.SoundOn)
     {
         ASound sound;
         if (m_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);
                 m_Sounds.Add(soundIndex, sound);
                 sound.Play(true, effect, volume, spamCheck);
             }
         }
     }
 }
示例#2
0
 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();
             }
         }
     }
 }
示例#3
0
 public void PlaySound(int soundIndex, AudioEffects effect = AudioEffects.None, float volume = 1.0f)
 {
     if (volume < 0.01f)
         return;
     if (Settings.Audio.SoundOn)
     {
         ASound sound;
         if (m_Sounds.TryGetValue(soundIndex, out sound))
         {
             sound.Play(true, effect, volume);
         }
         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(true, effect, volume);
             }
         }
     }
 }
示例#4
0
 public void PlaySound(int soundIndex)
 {
     UOSound sound;
     if (m_Sounds.TryGetValue(soundIndex, out sound))
     {
         if (sound.Status == SoundState.Loaded)
             sound.Play();
     }
     else
     {
         sound = new UOSound();
         m_Sounds.Add(soundIndex, sound);
         string name;
         byte[] data;
         if (SoundData.TryGetSoundData(soundIndex, out data, out name))
         {
             sound.Name = name;
             sound.WaveBuffer = data;
             sound.Status = SoundState.Loaded;
             sound.Play();
         }
     }
 }
示例#5
0
 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();
             }
         }
     }
 }