From fb7ef90fce5ba69597ce6bfdc8314b4edcd9d1fe Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 15 May 2021 11:00:42 +0200 Subject: [PATCH] Add option to hide GUI in Game Viewport --- Source/Editor/Windows/GameWindow.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index 5478cfbef..085cc56a6 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -38,7 +38,7 @@ namespace FlaxEditor.Windows _showGUI = value; // Update root if it's in game - if (Editor.StateMachine.IsPlayMode) + //if (Editor.StateMachine.IsPlayMode) _guiRoot.Visible = value; } } @@ -278,6 +278,18 @@ namespace FlaxEditor.Windows takeScreenshot.Clicked += TakeScreenshot; } + menu.AddSeparator(); + + // Show GUI + { + var showGui = menu.AddButton("Show GUI"); + var showGuiCheckbox = new CheckBox(140, 2, ShowGUI) + { + Parent = showGui + }; + showGuiCheckbox.StateChanged += x => ShowGUI = x.Checked; + } + menu.MinimumWidth = 200; menu.AddSeparator(); }