Beispiel #1
0
 public void PlaySound(string name, int vol)
 {
     if (paused)
     {
         return;
     }
     if (sounds.ContainsKey(name))
     {
         AudioEffect ass = ((AudioEffect)sounds.Get(name));
         ass.AudioEffectVolume(vol);
         ass.PlayAudioEffect();
     }
     else
     {
         if (clipCount > 50)
         {
             int         idx  = sounds.Size() - 1;
             string      k    = (string)sounds.GetKey(idx);
             AudioEffect clip = (AudioEffect)sounds.Remove(k);
             clip.StopAudioEffect();
             clip = null;
             clipCount--;
         }
         asound = new AudioEffect(name);
         asound.AudioEffectVolume(vol);
         asound.PlayAudioEffect();
         sounds.Put(name, asound);
         clipCount++;
     }
 }
Beispiel #2
0
 public void SetSoundVolume(int vol)
 {
     if (asound != null)
     {
         asound.AudioEffectVolume(vol);
     }
 }