示例#1
0
        protected override void OnPreUpdate()
        {
            if (_keyboard.IsKeyDown(KeyCode.Up))
            {
                _volume = Math.Min(1f, _volume + 0.001f);
                _soundEffects.SetVolume(_volume);
            }

            if (_keyboard.IsKeyDown(KeyCode.Down))
            {
                _volume = Math.Max(0f, _volume - 0.001f);
                _soundEffects.SetVolume(_volume);
            }
        }