Add Engine.FocusGameViewport to implement game menu with camera focus gather

This commit is contained in:
Wojciech Figat
2022-08-01 16:17:34 +02:00
parent 1d7e88635f
commit 7953f6cb83
7 changed files with 66 additions and 10 deletions

View File

@@ -471,6 +471,23 @@ namespace FlaxEditor.Windows
}
}
/// <summary>
/// Focuses the game viewport. Shows the window if hidden or unselected.
/// </summary>
public void FocusGameViewport()
{
if (!IsDocked)
{
ShowFloating();
}
else if (!IsSelected)
{
SelectTab(false);
RootWindow?.Window?.Focus();
}
Focus();
}
/// <summary>
/// Takes the screenshot of the current viewport.
/// </summary>