private void PinchSlider_ValueUpdated(object sender, SliderEventData eventData)
        {
            if (this.PlayTickSounds && this.PassNotchSound != null)
            {
                float delta = eventData.NewValue - eventData.OldValue;
                this.accumulatedDeltaSliderValue += Math.Abs(delta);

                var timeSinceLastSound = this.timeSinceStart - this.lastSoundPlayTime;
                if (this.accumulatedDeltaSliderValue > this.TickEvery && timeSinceLastSound > this.MinSecondsBetweenTicks)
                {
                    var pitch = MathHelper.Lerp(this.StartPitch, this.EndPitch, eventData.NewValue);
                    Tools.PlaySound(this.soundEmitter, this.PassNotchSound, pitch);

                    this.accumulatedDeltaSliderValue = 0;
                    this.lastSoundPlayTime           = this.timeSinceStart;
                }
            }
        }
Beispiel #2
0
 private void PinchSlider_ValueUpdated(object sender, SliderEventData e)
 {
     this.UpdateText(e.NewValue);
 }