Example #1
0
 public void SetSoundEffect()
 {
     if ((long)cfg.sound_effect == 0L)
     {
         SoundLib.EnableSoundEffect();
     }
     else
     {
         SoundLib.DisableSoundEffect();
     }
 }
Example #2
0
        private void BuildAdjustment()
        {
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Panning", new GUILayoutOption[0]);
            Single panningPosition = this.PanningPosition;

            this.PanningPosition = GUILayout.HorizontalSlider(this.PanningPosition, -1f, 1f, new GUILayoutOption[0]);
            if (panningPosition != this.PanningPosition)
            {
                this.soundViewController.SetMusicPanning(this.PanningPosition);
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label("Pitch", new GUILayoutOption[0]);
            Single pitchPosition = this.PitchPosition;

            this.PitchPosition = GUILayout.HorizontalSlider(this.PitchPosition, 0f, 2f, new GUILayoutOption[0]);
            if (pitchPosition != this.PitchPosition)
            {
                this.soundViewController.SetMusicPitch(this.PitchPosition);
            }
            GUILayout.EndHorizontal();
            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
            {
                this.SoundVolume     = 1f;
                this.PitchPosition   = 1f;
                this.PanningPosition = 0f;
                this.soundViewController.SetMusicVolume(this.SoundVolume);
                this.soundViewController.SetMusicPitch(this.PitchPosition);
                this.soundViewController.SetMusicPanning(this.PanningPosition);
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            if (this.isSfxEnabled)
            {
                if (GUILayout.Button("Disable SFX", new GUILayoutOption[0]))
                {
                    SoundLib.DisableSoundEffect();
                    this.isSfxEnabled = false;
                }
            }
            else if (GUILayout.Button("Enable SFX", new GUILayoutOption[0]))
            {
                SoundLib.EnableSoundEffect();
                this.isSfxEnabled = true;
            }
            if (this.isMusicEnabled)
            {
                if (GUILayout.Button("Disable Music", new GUILayoutOption[0]))
                {
                    SoundLib.DisableMusic();
                    this.isMusicEnabled = false;
                }
            }
            else if (GUILayout.Button("Enable Music", new GUILayoutOption[0]))
            {
                SoundLib.EnableMusic();
                this.isMusicEnabled = true;
            }
            if (GUILayout.Button("Next Loop Region", new GUILayoutOption[0]))
            {
                SoundLib.SetNextLoopRegion(71);
            }
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }