mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 19:22:54 +08:00
Fix fail animation breaking on post-fail judgements
This commit is contained in:
parent
e52a330dd8
commit
3276b9ae9c
@ -89,6 +89,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void applyToPlayfield(Playfield playfield)
|
private void applyToPlayfield(Playfield playfield)
|
||||||
{
|
{
|
||||||
|
double failTime = playfield.Time.Current;
|
||||||
|
|
||||||
foreach (var nested in playfield.NestedPlayfields)
|
foreach (var nested in playfield.NestedPlayfields)
|
||||||
applyToPlayfield(nested);
|
applyToPlayfield(nested);
|
||||||
|
|
||||||
@ -97,13 +99,29 @@ namespace osu.Game.Screens.Play
|
|||||||
if (appliedObjects.Contains(obj))
|
if (appliedObjects.Contains(obj))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
obj.RotateTo(RNG.NextSingle(-90, 90), duration);
|
float rotation = RNG.NextSingle(-90, 90);
|
||||||
obj.ScaleTo(obj.Scale * 0.5f, duration);
|
Vector2 originalPosition = obj.Position;
|
||||||
obj.MoveToOffset(new Vector2(0, 400), duration);
|
Vector2 originalScale = obj.Scale;
|
||||||
|
|
||||||
|
dropOffScreen(obj, failTime, rotation, originalScale, originalPosition);
|
||||||
|
|
||||||
|
// need to reapply the fail drop after judgement state changes
|
||||||
|
obj.ApplyCustomUpdateState += (o, _) => dropOffScreen(obj, failTime, rotation, originalScale, originalPosition);
|
||||||
|
|
||||||
appliedObjects.Add(obj);
|
appliedObjects.Add(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void dropOffScreen(DrawableHitObject obj, double failTime, float randomRotation, Vector2 originalScale, Vector2 originalPosition)
|
||||||
|
{
|
||||||
|
using (obj.BeginAbsoluteSequence(failTime))
|
||||||
|
{
|
||||||
|
obj.RotateTo(randomRotation, duration);
|
||||||
|
obj.ScaleTo(originalScale * 0.5f, duration);
|
||||||
|
obj.MoveTo(originalPosition + new Vector2(0, 400), duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
Loading…
Reference in New Issue
Block a user