Exemplo n.º 1
0
 private void SwitchSoundComannd(SoundComannd soundComannd)
 {
     if (soundComannd.comannd == SoundComanndStatus.Play)
     {
         float  volume;
         bool   loop = soundComannd.loop;
         string name = soundComannd.soundName;
         //音量
         if (soundComannd.soundVolume <= 100 && soundComannd.soundVolume >= 0)
         {
             volume = (float)soundComannd.soundVolume / 100;
         }
         else
         {
             volume = 1.0f;
         }
         SoundPlay(name, volume, loop);
     }
     else if (soundComannd.comannd == SoundComanndStatus.Stop)
     {
         SoundStop(soundComannd.soundName);
     }
     else if (soundComannd.comannd == SoundComanndStatus.Pause)
     {
         MuteSound(soundComannd.soundName);
     }
     else if (soundComannd.comannd == SoundComanndStatus.Resume)
     {
         ResumeSound(soundComannd.soundName);
     }
 }
Exemplo n.º 2
0
 private void SwitchSoundComannd(SoundComannd soundComannd)
 {
     if(soundComannd.comannd == SoundComanndStatus.Play)
     {
         float volume;
         bool loop = soundComannd.loop;
         string name = soundComannd.soundName;
         //音量
         if(soundComannd.soundVolume<=100 && soundComannd.soundVolume>=0)
             volume = (float)soundComannd.soundVolume/100;
         else volume = 1.0f;
         SoundPlay(name,volume,loop);
     }
     else if(soundComannd.comannd == SoundComanndStatus.Stop)
         SoundStop(soundComannd.soundName);
     else if(soundComannd.comannd == SoundComanndStatus.Pause)
         MuteSound(soundComannd.soundName);
     else if(soundComannd.comannd == SoundComanndStatus.Resume)
         ResumeSound(soundComannd.soundName);
 }