示例#1
0
        protected override void PopIn()
        {
            base.PopIn();

            pauseLoop.VolumeTo(1.0f, TRANSITION_DURATION, Easing.InQuint);
            pauseLoop.Play();
        }
 private void updateSpinningSample(ValueChangedEvent <bool> tracking)
 {
     // note that samples will not start playing if exiting a seek operation in the middle of a spinner.
     // may be something we want to address at a later point, but not so easy to make happen right now
     // (SkinnableSound would need to expose whether the sample is already playing and this logic would need to run in Update).
     if (tracking.NewValue && ShouldPlaySamples)
     {
         spinningSample?.Play();
         spinningSample?.VolumeTo(1, 200);
     }
     else
     {
         spinningSample?.VolumeTo(0, 200).Finally(_ => spinningSample.Stop());
     }
 }
示例#3
0
        private void load(OsuColour colours)
        {
            AddButton("Continue", colours.Green, () => OnResume?.Invoke());
            AddButton("Retry", colours.YellowDark, () => OnRetry?.Invoke());
            AddButton("Quit", new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());

            AddInternal(pauseLoop = new SkinnableSound(new SampleInfo("pause-loop"))
            {
                Looping = true,
            });

            // SkinnableSound only plays a sound if its aggregate volume is > 0, so the volume must be turned up before playing it
            pauseLoop.VolumeTo(minimum_volume);
        }