Remove triangles skin specific implementation from base DrawableHit

This commit is contained in:
Dean Herbert 2022-11-08 15:19:08 +09:00
parent 49f530910c
commit aa7d0e2c96
2 changed files with 23 additions and 7 deletions

View File

@ -201,12 +201,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
break; break;
case ArmedState.Hit: case ArmedState.Hit:
// If we're far enough away from the left stage, we should bring outselves in front of it // If we're far enough away from the left stage, we should bring ourselves in front of it
ProxyContent(); ProxyContent();
var flash = (MainPiece.Drawable as CirclePiece)?.FlashBox;
flash?.FadeTo(0.9f).FadeOut(300);
const float gravity_time = 300; const float gravity_time = 300;
const float gravity_travel_height = 200; const float gravity_travel_height = 200;

View File

@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
private readonly Container background; private readonly Container background;
public Box FlashBox; private readonly Box flashBox;
protected CirclePiece() protected CirclePiece()
{ {
@ -122,7 +122,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
Masking = true, Masking = true,
Children = new[] Children = new[]
{ {
FlashBox = new Box flashBox = new Box
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
@ -144,6 +144,25 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
}); });
} }
protected override void LoadComplete()
{
base.LoadComplete();
drawableHitObject.ApplyCustomUpdateState += updateStateTransforms;
updateStateTransforms(drawableHitObject, drawableHitObject.State.Value);
}
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
{
switch (state)
{
case ArmedState.Hit:
using (BeginAbsoluteSequence(drawableHitObject.HitStateUpdateTime))
flashBox?.FadeTo(0.9f).FadeOut(300);
break;
}
}
private const float edge_alpha_kiai = 0.5f; private const float edge_alpha_kiai = 0.5f;
private void resetEdgeEffects() private void resetEdgeEffects()
@ -166,7 +185,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
if (drawableHitObject.State.Value == ArmedState.Idle) if (drawableHitObject.State.Value == ArmedState.Idle)
{ {
FlashBox flashBox
.FadeTo(flash_opacity) .FadeTo(flash_opacity)
.Then() .Then()
.FadeOut(timingPoint.BeatLength * 0.75, Easing.OutSine); .FadeOut(timingPoint.BeatLength * 0.75, Easing.OutSine);