Пример #1
0
 private void Set_Sound()
 {
     for (int i = 0; i < 10; i++)
     {
         if (i == 1 || i == 9)
         {
             if (this.m_MuteBgm.IsChecked())
             {
                 TsAudio.SetMuteAudioType((EAudioType)i, true);
             }
             else
             {
                 bool mute = false;
                 if (this.m_BgmSound.Value <= 0.001f)
                 {
                     mute = true;
                 }
                 TsAudio.SetMuteAudioType((EAudioType)i, mute);
                 TsAudio.SetVolumeOfAudioType((EAudioType)i, this.m_BgmSound.Value);
             }
         }
         else if (this.m_MuteEffect.IsChecked())
         {
             TsAudio.SetMuteAudioType((EAudioType)i, true);
         }
         else
         {
             bool mute2 = false;
             if (this.m_EffectSound.Value <= 0.001f)
             {
                 mute2 = true;
             }
             TsAudio.SetMuteAudioType((EAudioType)i, mute2);
             TsAudio.SetVolumeOfAudioType((EAudioType)i, this.m_EffectSound.Value);
         }
     }
     TsAudio.RefreshAllAudioVolumes();
     TsAudio.RefreshAllMuteAudio();
 }
Пример #2
0
 private void ClickSave(IUIObject obj)
 {
     TsQualityManager.Instance.SaveCustomSettings();
     EAudioType[] array  = Enum.GetValues(typeof(EAudioType)) as EAudioType[];
     EAudioType[] array2 = array;
     for (int i = 0; i < array2.Length; i++)
     {
         EAudioType eAudioType = array2[i];
         if (eAudioType < EAudioType.TOTAL)
         {
             float value;
             bool  flag;
             if (eAudioType == EAudioType.BGM || eAudioType == EAudioType.BGM_STREAM)
             {
                 value = this.m_BgmSound.Value;
                 flag  = this.m_MuteBgm.IsChecked();
                 UIDataManager.MuteBGM = flag;
             }
             else
             {
                 value = this.m_EffectSound.Value;
                 flag  = this.m_MuteEffect.IsChecked();
                 UIDataManager.MuteEffect = flag;
             }
             TsAudio.SetVolumeOfAudioType(eAudioType, value);
             TsAudio.SetMuteAudioType(eAudioType, flag);
         }
     }
     TsAudio.SavePlayerPrefs();
     this.SaveCameraRotate();
     this.SaveFps();
     if (this.tabIndex == 8)
     {
         this.SavePushSetting(null);
     }
     this.SaveVibeSetting();
     this.CloseForm(null);
 }