Fix catching mouse focus in Editor play mode with game is paused
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user