Fix catching mouse focus in Editor play mode with game is paused

This commit is contained in:
Wojtek Figat
2021-05-15 11:01:11 +02:00
parent fb7ef90fce
commit 46b1fd944e
2 changed files with 3 additions and 1 deletions

View File

@@ -1185,6 +1185,8 @@ namespace FlaxEditor
var win = Windows.GameWin.Root;
if (win?.RootWindow is WindowRootControl root && root.Window && root.Window.IsFocused)
{
if (StateMachine.IsPlayMode && StateMachine.PlayingState.IsPaused)
return false;
return true;
}
}

View File

@@ -420,7 +420,7 @@ namespace FlaxEditor.Windows
base.OnStartContainsFocus();
// Center mouse in play mode
if (CenterMouseOnFocus && Editor.StateMachine.IsPlayMode)
if (CenterMouseOnFocus && Editor.StateMachine.IsPlayMode && !Editor.StateMachine.PlayingState.IsPaused)
{
Vector2 center = PointToWindow(Size * 0.5f);
Root.MousePosition = center;