Skip to content

Commit c9557b4

Browse files
committed
Fix various bugs related to Spinner Breaking Balls carried to other screens
1 parent 9e48b83 commit c9557b4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Entities/SpinnerBreakingBallGeneric.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ private void onTransitionOut() {
6161
// wipe the spinner connections so that they are computed again after the transition (in the new room).
6262
spinnerNeighbors = null;
6363
listOfSpinners = null;
64+
shatteredSpinners.Clear();
65+
66+
// stop the running computation of spinner connections (if any)
67+
computeSpinnerNeighborsToken?.Cancel();
68+
computeSpinnerNeighbors = null;
69+
computeSpinnerNeighborsToken = null;
6470
}
6571

6672
public override void Awake(Scene scene) {
@@ -110,11 +116,11 @@ public override void Update() {
110116

111117
public override void Removed(Scene scene) {
112118
base.Removed(scene);
113-
computeSpinnerNeighborsToken.Cancel();
119+
computeSpinnerNeighborsToken?.Cancel();
114120
}
115121
public override void SceneEnd(Scene scene) {
116122
base.SceneEnd(scene);
117-
computeSpinnerNeighborsToken.Cancel();
123+
computeSpinnerNeighborsToken?.Cancel();
118124
}
119125

120126
private Task computeSpinnerConnections(CancellationToken cancelToken) {

0 commit comments

Comments
 (0)