place core to start the game
This commit is contained in:
parent
3a25a1bd87
commit
1ecd054a31
8 changed files with 67 additions and 24 deletions
|
|
@ -39,11 +39,15 @@ fn pause_screen(mut contexts: EguiContexts) {
|
|||
|
||||
fn toggle_pause(
|
||||
state: Res<State<GameState>>,
|
||||
mut removed_cancellations: RemovedComponents<Cancellable>,
|
||||
mut next_state: ResMut<NextState<GameState>>,
|
||||
query: Query<(), With<Cancellable>>,
|
||||
) {
|
||||
if !query.is_empty() {
|
||||
// sometimes race condition can happen where the cancellable component gets cancelled before this system runs
|
||||
// instead of actually scheduling systems, I will just do this.
|
||||
if !query.is_empty() || !removed_cancellations.is_empty() {
|
||||
// cancelling takes priority over pausing
|
||||
removed_cancellations.clear();
|
||||
return;
|
||||
}
|
||||
let next = match state.get() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue