Beispiel #1
0
        public virtual void mute(bool hardMute)
        {
            if (volumes == null || isMuted)
            {
                return;                 //object may not have defined any sounds to be muted.
            }
            //Or we've already muted.

            /*Holders will keep calling mute()
             * Even though they may already have called it.
             * This way, objects that are inserted into the holders after the mute operation will also be muted.
             * */
            for (int i = 0; i < ctrlVolume.Count; i++)
            {
                volumes.Add(ctrlVolume[i].Volume);
                if (ctrlVolume[i].Volume > -8000)
                {
                    ctrlVolume[i].Volume = -8000;
                }
                if (hardMute)
                {
                    looping.Add(DSound.isLooping(ctrlVolume[i]));
                    ctrlVolume[i].Stop();
                }
            }
            isMuted = true;
        }
 public bool isFinished()
 {
     if (moveSound == null)             //clean up has occurred
     {
         return(true);
     }
     if (DSound.isLooping(moveSound))
     {
         return(false);
     }
     return(!DSound.isPlaying(explodeSound));
 }