Update loop logic in line with framework changes

This commit is contained in:
Dean Herbert
2017-07-09 18:23:34 +09:00
parent bde06d466a
commit 2c8b8c3f9c
7 changed files with 68 additions and 144 deletions

View File

@ -203,6 +203,8 @@ namespace osu.Game.Overlays.Notifications
get { return pulsate; }
set
{
if (pulsate == value) return;
pulsate = value;
pulsateLayer.ClearTransforms();
@ -211,25 +213,12 @@ namespace osu.Game.Overlays.Notifications
if (pulsate)
{
const float length = 1000;
pulsateLayer.Transforms.Add(new TransformAlpha
using (pulsateLayer.BeginLoopedSequece(length / 2))
{
StartTime = Time.Current,
EndTime = Time.Current + length,
StartValue = 1,
EndValue = 0.4f,
Easing = EasingTypes.In
});
pulsateLayer.Transforms.Add(new TransformAlpha
{
StartTime = Time.Current + length,
EndTime = Time.Current + length * 2,
StartValue = 0.4f,
EndValue = 1,
Easing = EasingTypes.Out
});
//todo: figure why we can't add arbitrary delays at the end of loop.
pulsateLayer.Loop(length * 2);
pulsateLayer.FadeTo(0.4f, length, EasingTypes.In);
using (pulsateLayer.BeginDelayedSequence(length))
pulsateLayer.FadeTo(1, length, EasingTypes.Out);
}
}
}
}