outfrost / deckswipe

Single player card game skeleton based on Reigns and Lapse
MIT License
75 stars 29 forks source link

Exit the game by pressing Back #9

Closed outfrost closed 4 years ago

outfrost commented 6 years ago

Make the game exit after one or more presses of the Back button.

stormofice commented 4 years ago

This was already fixed by adding the following lines to Game.cs

// Listen for Escape key ('Back' on Android) to quit the game
inputDispatcher.AddKeyDownHandler(KeyCode.Escape,
    keyCode => Application.Quit());

https://github.com/outfrost/deckswipe/blob/master/DeckSwipe/Assets/DeckSwipe/Game.cs#L33

outfrost commented 4 years ago

Sort of. It's still open under "To Be Revisited" in the project, as a note to myself that maybe this should interoperate a bit better with Android, e.g. not terminate the app on Back, but background it instead. See also #26.