1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Switch to strong sprite exactly once

This commit is contained in:
Bartłomiej Dach 2020-09-28 16:38:30 +02:00
parent 0900661b23
commit f6f267a43a

View File

@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning
private DrawableHit hit;
private DrawableStrongNestedHit nestedStrongHit;
private bool switchedToStrongSprite;
/// <summary>
/// Creates a new legacy hit explosion.
@ -84,16 +85,17 @@ namespace osu.Game.Rulesets.Taiko.Skinning
{
base.Update();
if (shouldSwitchToStrongSprite() && strongSprite != null)
if (shouldSwitchToStrongSprite() && !switchedToStrongSprite)
{
sprite.FadeOut(50, Easing.OutQuint);
strongSprite.FadeIn(50, Easing.OutQuint);
switchedToStrongSprite = true;
}
}
private bool shouldSwitchToStrongSprite()
{
if (hit == null || nestedStrongHit == null)
if (hit == null || nestedStrongHit == null || strongSprite == null)
return false;
return nestedStrongHit.IsHit;