mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-24 04:40:53 +00:00
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:
parent
21ad422f46
commit
269a211e1e
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user