Add Engine.FocusGameViewport to implement game menu with camera focus gather
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user