Move "flash on hit only" logic to binding

This commit is contained in:
Dean Herbert
2020-10-16 14:49:05 +09:00
parent 5be9e30cd0
commit a810f56ec8
2 changed files with 9 additions and 9 deletions

View File

@ -315,8 +315,14 @@ namespace osu.Game.Screens.Play
AccuracyCounter?.Current.BindTo(processor.Accuracy);
ComboCounter?.Current.BindTo(processor.Combo);
if (HealthDisplay.Drawable is IHealthDisplay shd)
processor.NewJudgement += shd.Flash;
if (HealthDisplay is IHealthDisplay shd)
{
processor.NewJudgement += judgement =>
{
if (judgement.IsHit)
shd.Flash(judgement);
};
}
}
protected virtual void BindHealthProcessor(HealthProcessor processor)