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

Fix mascot getting stuck in clear state on rewind

This commit is contained in:
Dean Herbert 2020-05-14 09:44:21 +09:00
parent 0933217389
commit 9ba1a8af88
2 changed files with 6 additions and 3 deletions

View File

@ -96,9 +96,9 @@ namespace osu.Game.Rulesets.Taiko.UI
private TaikoMascotAnimationState getNextState()
{
// don't change state if current animation is playing
// (used for clear state - others are manually animated on new beats)
if (currentAnimation != null && !currentAnimation.Completed)
// don't change state if current animation is still playing (and we haven't rewound before it).
// used for clear state - others are manually animated on new beats.
if (currentAnimation?.Completed == false && currentAnimation.DisplayTime <= Time.Current)
return State.Value;
if (!lastObjectHit)

View File

@ -20,6 +20,8 @@ namespace osu.Game.Rulesets.Taiko.UI
private int currentFrame;
public double DisplayTime;
public TaikoMascotAnimation(TaikoMascotAnimationState state)
{
InternalChild = textureAnimation = createTextureAnimation(state).With(animation =>
@ -40,6 +42,7 @@ namespace osu.Game.Rulesets.Taiko.UI
public override void Show()
{
base.Show();
DisplayTime = Time.Current;
textureAnimation.Seek(0);
}