mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
make transform duration for bubble a method instead of a variable
This commit is contained in:
parent
82292d6162
commit
e9a7d90273
@ -187,26 +187,26 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
//We want to fade to a darker colour to avoid colours such as white hiding the "ripple" effect.
|
//We want to fade to a darker colour to avoid colours such as white hiding the "ripple" effect.
|
||||||
ColourInfo colourDarker = Info.Colour.Darken(0.1f);
|
ColourInfo colourDarker = Info.Colour.Darken(0.1f);
|
||||||
|
|
||||||
|
// The absolute length of the bubble's animation, can be used in fractions for animations of partial length
|
||||||
|
double getAnimationDuration = 1700 + Math.Pow(Info.FadeTime, 1.07f);
|
||||||
|
|
||||||
// Main bubble scaling based on combo
|
// Main bubble scaling based on combo
|
||||||
this.ScaleTo(Info.MaxSize, getAnimationDuration() * 0.8f)
|
this.ScaleTo(Info.MaxSize, getAnimationDuration * 0.8f)
|
||||||
.Then()
|
.Then()
|
||||||
// Pop at the end of the bubbles life time
|
// Pop at the end of the bubbles life time
|
||||||
.ScaleTo(Info.MaxSize * 1.5f, getAnimationDuration() * 0.2f, Easing.OutQuint)
|
.ScaleTo(Info.MaxSize * 1.5f, getAnimationDuration * 0.2f, Easing.OutQuint)
|
||||||
.FadeOutFromOne(getAnimationDuration() * 0.2f, Easing.OutCirc).Expire();
|
.FadeOutFromOne(getAnimationDuration * 0.2f, Easing.OutCirc).Expire();
|
||||||
|
|
||||||
if (Info.IsHit)
|
if (Info.IsHit)
|
||||||
{
|
{
|
||||||
colourBox.FadeColour(colourDarker);
|
colourBox.FadeColour(colourDarker);
|
||||||
|
|
||||||
content.TransformTo(nameof(BorderColour), colourDarker, getAnimationDuration() * 0.3f, Easing.OutQuint);
|
content.TransformTo(nameof(BorderColour), colourDarker, getAnimationDuration * 0.3f, Easing.OutQuint);
|
||||||
// Ripple effect utilises the border to reduce drawable count
|
// Ripple effect utilises the border to reduce drawable count
|
||||||
content.TransformTo(nameof(BorderThickness), 2f, getAnimationDuration() * 0.3f, Easing.OutQuint)
|
content.TransformTo(nameof(BorderThickness), 2f, getAnimationDuration * 0.3f, Easing.OutQuint)
|
||||||
// Avoids transparency overlap issues during the bubble "pop"
|
// Avoids transparency overlap issues during the bubble "pop"
|
||||||
.Then().Schedule(() => content.BorderThickness = 0);
|
.Then().Schedule(() => content.BorderThickness = 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The absolute length of the bubble's animation, can be used in fractions for animations of partial length
|
|
||||||
double getAnimationDuration() => 1700 + Math.Pow(Info.FadeTime, 1.07f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user