1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Simplify animations

This commit is contained in:
mk56-spn 2023-01-28 00:30:30 +01:00
parent 7c81f1e75b
commit c3090dea5f

View File

@ -214,23 +214,29 @@ namespace osu.Game.Rulesets.Osu.Mods
{
Size = entry.InitialSize;
this.ScaleTo(entry.MaxSize, getAnimationTime() * 0.8f, Easing.OutSine)
//We want to fade to a darker colour to avoid colours such as white hiding the "ripple" effect.
var colourDarker = entry.Colour.Darken(0.1f);
this.ScaleTo(entry.MaxSize, getAnimationDuration() * 0.8f, Easing.OutSine)
.Then()
.ScaleTo(entry.MaxSize * 1.5f, getAnimationTime() * 0.2f, Easing.OutSine)
.FadeTo(0, getAnimationTime() * 0.2f, Easing.OutExpo);
.ScaleTo(entry.MaxSize * 1.5f, getAnimationDuration() * 0.2f, Easing.OutSine)
.FadeTo(0, getAnimationDuration() * 0.2f, Easing.OutExpo);
colourBox.FadeColour(entry.IsHit ? entry.Colour : Colour4.Black, getAnimationTime() * 0.1f, Easing.OutSine)
.Then()
.FadeColour(entry.IsHit ? entry.Colour.Darken(0.4f) : Colour4.Black, getAnimationTime() * 0.9f, Easing.OutSine);
innerCircle.ScaleTo(2f, getAnimationDuration() * 0.8f, Easing.OutCubic);
innerCircle.FadeColour(entry.IsHit ? entry.Colour.Darken(0.2f) : Colour4.Black)
.FadeColour(entry.IsHit ? entry.Colour.Lighten(0.2f) : Colour4.Black, getAnimationTime());
if (!entry.IsHit)
{
colourBox.Colour = Colour4.Black;
innerCircle.Colour = Colour4.Black;
innerCircle.FadeTo(0.5f, getAnimationTime(), Easing.InExpo)
.ScaleTo(2.2f, getAnimationTime(), Easing.InSine);
return;
}
colourBox.FadeColour(colourDarker, getAnimationDuration() * 0.2f, Easing.OutQuint);
innerCircle.FadeColour(colourDarker);
// The absolute length of the bubble's animation, can be used in fractions for animations of partial length
double getAnimationTime() => 2000 + 450 / (450 / entry.FadeTime);
double getAnimationDuration() => 1700 + Math.Pow(entry.FadeTime, 1.15f);
}
}