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

@@ -1301,6 +1301,17 @@ namespace FlaxEditor
return false;
}
internal void Internal_FocusGameViewport()
{
if (Windows.GameWin != null)
{
if (StateMachine.IsPlayMode && !StateMachine.PlayingState.IsPaused)
{
Windows.GameWin.FocusGameViewport();
}
}
}
internal void Internal_ScreenToGameViewport(ref Float2 pos)
{
var win = Windows.GameWin?.Root;