Add option to hide GUI in Game Viewport

This commit is contained in:
Wojtek Figat
2021-05-15 11:00:42 +02:00
parent 8e31c49f1c
commit fb7ef90fce

View File

@@ -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();
}