Skip to content

Commit

Permalink
Remove entity modifiers when removing GameplaySpinners
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Feb 6, 2025
1 parent 7366ae7 commit 541d36a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ru/nsu/ccfit/zuev/osu/game/GameplayModernSpinner.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,21 @@ public void update(float dt) {

@Override
public void removeFromScene() {
glow.clearEntityModifiers();
middle.clearEntityModifiers();
scene.detachChild(middle);

middle2.clearEntityModifiers();
scene.detachChild(middle2);

bottom.clearEntityModifiers();
scene.detachChild(bottom);

top.clearEntityModifiers();
scene.detachChild(top);

glow.clearEntityModifiers();
scene.detachChild(glow);

scene.detachChild(bonusScore);

listener.removeObject(GameplayModernSpinner.this);
Expand Down
13 changes: 13 additions & 0 deletions src/ru/nsu/ccfit/zuev/osu/game/GameplaySpinner.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,25 @@ public void init(final GameObjectListener listener, final Scene scene,
}

void removeFromScene() {
clearText.clearEntityModifiers();
scene.detachChild(clearText);

spinText.clearEntityModifiers();
scene.detachChild(spinText);

background.clearEntityModifiers();
scene.detachChild(background);

approachCircle.clearEntityModifiers();
approachCircle.detachSelf();

circle.clearEntityModifiers();
scene.detachChild(circle);

metre.clearEntityModifiers();
scene.detachChild(metre);


scene.detachChild(bonusScore);

listener.removeObject(GameplaySpinner.this);
Expand Down

0 comments on commit 541d36a

Please sign in to comment.