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(OnEnter(AppState::MenuRunning), setup_main_menu)
|
||||||
.add_systems(OnExit(AppState::MenuRunning), teardown_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);
|
.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(OnEnter(AppState::MenuRunning), setup_main_menu)
|
||||||
.add_systems(OnExit(AppState::MenuRunning), teardown_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);
|
.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(OnEnter(AppState::MenuRunning), setup_main_menu)
|
||||||
.add_systems(OnExit(AppState::MenuRunning), teardown_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);
|
.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(OnEnter(AppState::MenuRunning), setup_main_menu)
|
||||||
.add_systems(OnExit(AppState::MenuRunning), teardown_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);
|
.add_systems(OnEnter(AppState::AppRunning), setup_game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue