Skip to content

Commit 899b48b

Browse files
Add return statement after pausing the game (#230)
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 <darkside@zenithmoon.com>
1 parent f3df5d7 commit 899b48b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ private void CheckKeyboardInput()
77
if (Core.Input.Keyboard.WasKeyJustPressed(Keys.Escape))
88
{
99
PauseGame();
10+
return;
1011
}
1112

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

0 commit comments

Comments
 (0)