Skip to content

Commit b1ce5af

Browse files
Add return statement after pausing the game (#231)
After Pause mode kicks in, we don't need to run the rest of this function. I was hitting a crash because the checks below this part were still executing Co-authored-by: Simon (Darkside) Jackson <[email protected]>
1 parent 899b48b commit b1ce5af

File tree

1 file changed

+2
-1
lines changed
  • articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene

1 file changed

+2
-1
lines changed

articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/gamescene/checkgamepadinput.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ private void CheckGamePadInput()
77
if (gamePadOne.WasButtonJustPressed(Buttons.Start))
88
{
99
PauseGame();
10+
return;
1011
}
1112

1213
// Existing gamepad input code
13-
// ...
14+
// ...

0 commit comments

Comments
 (0)