From cdae95b4b8845787f818e90160cfe5881df55f4a Mon Sep 17 00:00:00 2001 From: giusdp Date: Fri, 14 May 2021 20:15:54 +0000 Subject: [PATCH] Add exit_on_esc_system to examples with window (#2121) This covers issue #2110 It adds the line `.add_system(bevy::input::system::exit_on_esc_system.system())` before `.run()` to every example that uses a window, so users have a quick way to close the examples. I used the full name `bevy::input::system::exit_on_esc_system`, I thought it gave clarity about being a built-in system. The examples excluded from the change are the ones in the android, ios, wasm folders, the headless examples and the ecs/system_sets example because it closes itself. --- examples/game/alien_cake_addict.rs | 1 + examples/game/breakout.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/game/alien_cake_addict.rs b/examples/game/alien_cake_addict.rs index c374500fcebd0..464d281d9511c 100644 --- a/examples/game/alien_cake_addict.rs +++ b/examples/game/alien_cake_addict.rs @@ -40,6 +40,7 @@ fn main() { .with_run_criteria(FixedTimestep::step(5.0)) .with_system(spawn_bonus.system()), ) + .add_system(bevy::input::system::exit_on_esc_system.system()) .run(); } diff --git a/examples/game/breakout.rs b/examples/game/breakout.rs index 5fc2ccf143efa..549faa64ac558 100644 --- a/examples/game/breakout.rs +++ b/examples/game/breakout.rs @@ -21,6 +21,7 @@ fn main() { .with_system(ball_movement_system.system()), ) .add_system(scoreboard_system.system()) + .add_system(bevy::input::system::exit_on_esc_system.system()) .run(); }