Skip to content

Commit

Permalink
Fix various bugs related to Spinner Breaking Balls carried to other s…
Browse files Browse the repository at this point in the history
…creens
  • Loading branch information
maddie480 committed Sep 11, 2024
1 parent 9e48b83 commit c9557b4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Entities/SpinnerBreakingBallGeneric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ private void onTransitionOut() {
// wipe the spinner connections so that they are computed again after the transition (in the new room).
spinnerNeighbors = null;
listOfSpinners = null;
shatteredSpinners.Clear();

// stop the running computation of spinner connections (if any)
computeSpinnerNeighborsToken?.Cancel();
computeSpinnerNeighbors = null;
computeSpinnerNeighborsToken = null;
}

public override void Awake(Scene scene) {
Expand Down Expand Up @@ -110,11 +116,11 @@ public override void Update() {

public override void Removed(Scene scene) {
base.Removed(scene);
computeSpinnerNeighborsToken.Cancel();
computeSpinnerNeighborsToken?.Cancel();
}
public override void SceneEnd(Scene scene) {
base.SceneEnd(scene);
computeSpinnerNeighborsToken.Cancel();
computeSpinnerNeighborsToken?.Cancel();
}

private Task computeSpinnerConnections(CancellationToken cancelToken) {
Expand Down

0 comments on commit c9557b4

Please sign in to comment.