WIP : replaced TransformBindableTo by VolumeTo

Currently, the VolumeTO calls taht use a fading does not do anything.
calling VolumeTo calls pauseLoop.samplesContainer.TransformBindableTo(....), while i used to call pauseLoop.TransformBindableTo(....)
This commit is contained in:
BananeVolante 2020-07-03 14:33:42 +02:00
parent 3c2870ea4b
commit e8f23e35a5

View File

@ -3,8 +3,10 @@
using System; using System;
using System.Linq; using System.Linq;
using NUnit.Framework.Internal;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio;
using osu.Game.Audio; using osu.Game.Audio;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Skinning; using osu.Game.Skinning;
@ -44,8 +46,8 @@ namespace osu.Game.Screens.Play
base.PopIn(); base.PopIn();
//SkinnableSound only plays a sound if its aggregate volume is > 0, so the volume must be turned up before playing it //SkinnableSound only plays a sound if its aggregate volume is > 0, so the volume must be turned up before playing it
pauseLoop.TransformBindableTo(pauseLoop.Volume, 0.00001); pauseLoop.VolumeTo(0.00001f);
pauseLoop.TransformBindableTo(pauseLoop.Volume, 1.0f, 400, Easing.InQuint); pauseLoop.VolumeTo(1.0f, 400, Easing.InQuint);
pauseLoop.Play(); pauseLoop.Play();
} }
@ -53,8 +55,9 @@ namespace osu.Game.Screens.Play
{ {
base.PopOut(); base.PopOut();
pauseLoop.Stop(); var transformSeq = pauseLoop.VolumeTo(0.0f, 190, Easing.OutQuad );
pauseLoop.TransformBindableTo(pauseLoop.Volume, 0.0f); transformSeq.Finally(_ => pauseLoop.Stop());
} }
} }
} }