From 0724178d07c5fe8f6dbfd1255c58282d94a1690d Mon Sep 17 00:00:00 2001 From: rewin Date: Wed, 22 May 2024 23:43:41 +0300 Subject: [PATCH] Fix camera viewport in game mode and fix bottom tool bar --- crates/editor_ui/src/menu_toolbars.rs | 2 +- crates/editor_ui/src/ui_plugin.rs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/editor_ui/src/menu_toolbars.rs b/crates/editor_ui/src/menu_toolbars.rs index 87542c44..f6a68e38 100644 --- a/crates/editor_ui/src/menu_toolbars.rs +++ b/crates/editor_ui/src/menu_toolbars.rs @@ -40,7 +40,7 @@ impl Plugin for BottomMenuPlugin { bottom_menu .before(EditorLoadSet) .in_set(EditorSet::Editor) - .run_if(in_state(EditorState::Editor).and_then(in_state(ShowEditorUi::Show))), + .run_if(in_state(ShowEditorUi::Show)), ); app.add_systems( Update, diff --git a/crates/editor_ui/src/ui_plugin.rs b/crates/editor_ui/src/ui_plugin.rs index 0a8ad348..abb3d475 100644 --- a/crates/editor_ui/src/ui_plugin.rs +++ b/crates/editor_ui/src/ui_plugin.rs @@ -133,10 +133,7 @@ impl Plugin for EditorUiCore { .run_if(has_window_changed) .in_set(UiSystemSet), ); - app.add_systems( - Update, - reset_camera_viewport.run_if(in_state(EditorState::Game)), - ); + app.add_systems(OnEnter(ShowEditorUi::Hide), reset_camera_viewport); app.editor_tab_by_trait(EditorTabName::GameView, GameViewTab::default());