fix(bevy_gltf_blueprints): fixed main_menu handling in examples

* restrict main_menu system to only run in AppState::MenuRunning 
* this is desired because hitting enter once we transition to AppState::AppRunning pressing enter will still trigger keycode.just_pressed in main_menu and set state to AppState::AppLoading and crash the game when it tries to create another scene, camera, etc...
This commit is contained in:
Shawn Workman 2023-11-30 14:11:09 -08:00 committed by GitHub
parent 21ad422f46
commit 269a211e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ impl Plugin for GamePlugin {
)
.add_systems(OnEnter(AppState::MenuRunning), setup_main_menu)
.add_systems(OnExit(AppState::MenuRunning), teardown_main_menu)
.add_systems(Update, (main_menu))
.add_systems(Update, main_menu.run_if(in_state(AppState::MenuRunning)))
.add_systems(OnEnter(AppState::AppRunning), setup_game);
}
}

View File

@ -109,7 +109,7 @@ impl Plugin for GamePlugin {
)
.add_systems(OnEnter(AppState::MenuRunning), setup_main_menu)
.add_systems(OnExit(AppState::MenuRunning), teardown_main_menu)
.add_systems(Update, (main_menu))
.add_systems(Update, main_menu.run_if(in_state(AppState::MenuRunning)))
.add_systems(OnEnter(AppState::AppRunning), setup_game);
}
}

View File

@ -101,7 +101,7 @@ impl Plugin for GamePlugin {
)
.add_systems(OnEnter(AppState::MenuRunning), setup_main_menu)
.add_systems(OnExit(AppState::MenuRunning), teardown_main_menu)
.add_systems(Update, (main_menu))
.add_systems(Update, main_menu.run_if(in_state(AppState::MenuRunning)))
.add_systems(OnEnter(AppState::AppRunning), setup_game);
}
}

View File

@ -115,7 +115,7 @@ impl Plugin for GamePlugin {
)
.add_systems(OnEnter(AppState::MenuRunning), setup_main_menu)
.add_systems(OnExit(AppState::MenuRunning), teardown_main_menu)
.add_systems(Update, (main_menu))
.add_systems(Update, main_menu.run_if(in_state(AppState::MenuRunning)))
.add_systems(OnEnter(AppState::AppRunning), setup_game);
}
}