mirror of
https://github.com/ppy/osu
synced 2024-12-28 18:02:53 +00:00
Merge pull request #10203 from peppy/fix-fail-animation
Fix fail animation breaking on post-fail judgements
This commit is contained in:
commit
3d90bb5e38
@ -89,6 +89,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private void applyToPlayfield(Playfield playfield)
|
||||
{
|
||||
double failTime = playfield.Time.Current;
|
||||
|
||||
foreach (var nested in playfield.NestedPlayfields)
|
||||
applyToPlayfield(nested);
|
||||
|
||||
@ -97,13 +99,29 @@ namespace osu.Game.Screens.Play
|
||||
if (appliedObjects.Contains(obj))
|
||||
continue;
|
||||
|
||||
obj.RotateTo(RNG.NextSingle(-90, 90), duration);
|
||||
obj.ScaleTo(obj.Scale * 0.5f, duration);
|
||||
obj.MoveToOffset(new Vector2(0, 400), duration);
|
||||
float rotation = RNG.NextSingle(-90, 90);
|
||||
Vector2 originalPosition = obj.Position;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
Loading…
Reference in New Issue
Block a user