Tidy up and tweak transitions of DrawableJudgementInfo.

This commit is contained in:
Dean Herbert
2017-03-23 15:07:45 +09:00
parent acfa4a4aac
commit 02fba000bc
3 changed files with 30 additions and 23 deletions

View File

@ -44,16 +44,14 @@ namespace osu.Game.Modes.Taiko.UI
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); switch (Judgement.Result)
if (Judgement.Result == HitResult.Hit)
{ {
MoveToY(-100, 500); case HitResult.Hit:
Delay(250); MoveToY(-100, 500);
FadeOut(250); break;
} }
Expire(); base.LoadComplete();
} }
} }
} }

View File

@ -179,19 +179,17 @@ namespace osu.Game.Modes.Taiko.UI
public override void OnJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgementInfo> judgedObject) public override void OnJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgementInfo> judgedObject)
{ {
if (judgedObject.Judgement.Result == HitResult.Hit) bool wasHit = judgedObject.Judgement.Result == HitResult.Hit;
{
hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement));
}
float judgementOffset = judgedObject.Judgement.Result == HitResult.Hit ? judgedObject.Position.X : 0; if (wasHit)
hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement));
judgementContainer.Add(new DrawableTaikoJudgementInfo(judgedObject.Judgement) judgementContainer.Add(new DrawableTaikoJudgementInfo(judgedObject.Judgement)
{ {
Anchor = judgedObject.Judgement.Result == HitResult.Hit ? Anchor.TopLeft : Anchor.BottomLeft, Anchor = wasHit ? Anchor.TopLeft : Anchor.CentreLeft,
Origin = judgedObject.Judgement.Result == HitResult.Hit ? Anchor.BottomCentre : Anchor.TopCentre, Origin = wasHit ? Anchor.BottomCentre : Anchor.Centre,
RelativePositionAxes = Axes.X, RelativePositionAxes = Axes.X,
X = judgementOffset, X = wasHit ? judgedObject.Position.X : 0,
}); });
} }
} }

View File

@ -25,6 +25,8 @@ namespace osu.Game.Modes.Judgements
protected readonly SpriteText JudgementText; protected readonly SpriteText JudgementText;
protected double HitVisibleLength => 600;
/// <summary> /// <summary>
/// Creates a drawable which visualises a <see cref="JudgementInfo"/>. /// Creates a drawable which visualises a <see cref="JudgementInfo"/>.
/// </summary> /// </summary>
@ -65,18 +67,27 @@ namespace osu.Game.Modes.Judgements
{ {
base.LoadComplete(); base.LoadComplete();
if (Judgement.Result == HitResult.Miss) FadeInFromZero(100, EasingTypes.OutQuint);
switch (Judgement.Result)
{ {
FadeInFromZero(60); case HitResult.Miss:
ScaleTo(1.6f);
ScaleTo(1, 100, EasingTypes.In);
ScaleTo(1.6f); MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint);
ScaleTo(1, 100, EasingTypes.In); RotateTo(40, 800, EasingTypes.InQuint);
MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint); Delay(600);
RotateTo(40, 800, EasingTypes.InQuint); FadeOut(200);
break;
case HitResult.Hit:
ScaleTo(0.9f);
ScaleTo(1, 500, EasingTypes.OutElastic);
Delay(600); Delay(250);
FadeOut(200); FadeOut(250, EasingTypes.OutQuint);
break;
} }
Expire(); Expire();