1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:43:04 +08:00
This commit is contained in:
Terochi 2023-04-21 21:46:03 +02:00
parent cc96d275c2
commit 847b63066b

View File

@ -418,10 +418,13 @@ namespace osu.Game.Rulesets.Catch.UI
private void clearPlate(DroppedObjectAnimation animation)
{
var droppedObjects = caughtObjectContainer.Children.Select(getDroppedObject).ToArray();
var caughtObjects = caughtObjectContainer.Children.ToArray();
caughtObjectContainer.Clear(false);
//use the already returned PoolableDrawables for new objects
var droppedObjects = caughtObjects.Select(getDroppedObject).ToArray();
droppedObjectTarget.AddRange(droppedObjects);
foreach (var droppedObject in droppedObjects)
@ -430,13 +433,11 @@ namespace osu.Game.Rulesets.Catch.UI
private void removeFromPlate(CaughtObject caughtObject, DroppedObjectAnimation animation)
{
var droppedObject = getDroppedObject(caughtObject);
caughtObjectContainer.Remove(caughtObject, false);
droppedObjectTarget.Add(droppedObject);
droppedObjectTarget.Add(getDroppedObject(caughtObject));
applyDropAnimation(droppedObject, animation);
applyDropAnimation(caughtObject, animation);
}
private void applyDropAnimation(Drawable d, DroppedObjectAnimation animation)
@ -456,6 +457,8 @@ namespace osu.Game.Rulesets.Catch.UI
break;
}
//define lifetime start for dropped objects to be disposed correctly when rewinding replay
d.LifetimeStart = Clock.CurrentTime;
d.Expire();
}