Check for Game window before usage to avoid errors in trying to unplay.
This commit is contained in:
@@ -306,19 +306,21 @@ namespace FlaxEditor.Modules
|
|||||||
public override void OnPlayEnd()
|
public override void OnPlayEnd()
|
||||||
{
|
{
|
||||||
var gameWin = Editor.Windows.GameWin;
|
var gameWin = Editor.Windows.GameWin;
|
||||||
|
if (gameWin != null)
|
||||||
switch (gameWin.FocusOnPlayOption)
|
|
||||||
{
|
{
|
||||||
case Options.InterfaceOptions.PlayModeFocus.None: break;
|
switch (gameWin.FocusOnPlayOption)
|
||||||
case Options.InterfaceOptions.PlayModeFocus.GameWindow: break;
|
|
||||||
case Options.InterfaceOptions.PlayModeFocus.GameWindowThenRestore:
|
|
||||||
if (_previousWindow != null && !_previousWindow.IsDisposing)
|
|
||||||
{
|
{
|
||||||
if (!Editor.Windows.GameWin.ParentDockPanel.ContainsTab(_previousWindow))
|
case Options.InterfaceOptions.PlayModeFocus.None: break;
|
||||||
break;
|
case Options.InterfaceOptions.PlayModeFocus.GameWindow: break;
|
||||||
_previousWindow.Focus();
|
case Options.InterfaceOptions.PlayModeFocus.GameWindowThenRestore:
|
||||||
|
if (_previousWindow != null && !_previousWindow.IsDisposing)
|
||||||
|
{
|
||||||
|
if (!Editor.Windows.GameWin.ParentDockPanel.ContainsTab(_previousWindow))
|
||||||
|
break;
|
||||||
|
_previousWindow.Focus();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Editor.UI.UncheckPauseButton();
|
Editor.UI.UncheckPauseButton();
|
||||||
|
|||||||
Reference in New Issue
Block a user