Split out taiko DefaultJudgementPiece and move animations across

This commit is contained in:
Dean Herbert 2022-11-07 16:31:06 +09:00
parent cb6b9898c1
commit 8745c2f016
2 changed files with 34 additions and 26 deletions

View File

@ -0,0 +1,32 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Skinning.Default
{
public class DefaultJudgementPiece : Rulesets.Judgements.DefaultJudgementPiece
{
public DefaultJudgementPiece(HitResult result)
: base(result)
{
}
public override void PlayAnimation()
{
if (Result != HitResult.Miss)
{
this
.MoveToY(0)
.MoveToY(-100, 500);
JudgementText
.ScaleTo(0.9f)
.ScaleTo(1, 500, Easing.OutElastic);
}
base.PlayAnimation();
}
}
}

View File

@ -4,6 +4,7 @@
using osu.Framework.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
using DefaultJudgementPiece = osu.Game.Rulesets.Taiko.Skinning.Default.DefaultJudgementPiece;
namespace osu.Game.Rulesets.Taiko.UI
{
@ -12,31 +13,6 @@ namespace osu.Game.Rulesets.Taiko.UI
/// </summary>
public class DrawableTaikoJudgement : DrawableJudgement
{
protected override void ApplyHitAnimations()
{
this.MoveToY(-100, 500);
base.ApplyHitAnimations();
}
protected override Drawable CreateDefaultJudgement(HitResult result) => new TaikoJudgementPiece(result);
private class TaikoJudgementPiece : DefaultJudgementPiece
{
public TaikoJudgementPiece(HitResult result)
: base(result)
{
}
public override void PlayAnimation()
{
if (Result != HitResult.Miss)
{
JudgementText.ScaleTo(0.9f);
JudgementText.ScaleTo(1, 500, Easing.OutElastic);
}
base.PlayAnimation();
}
}
protected override Drawable CreateDefaultJudgement(HitResult result) => new DefaultJudgementPiece(result);
}
}