gamemode spawning
This commit is contained in:
@@ -87,7 +87,7 @@ namespace Cabrito
|
||||
|
||||
#if FLAX_EDITOR
|
||||
ScriptsBuilder.ScriptsReload += Destroy;
|
||||
Editor.Instance.StateMachine.StateChanged += OnEditorStateChanged;
|
||||
Editor.Instance.PlayModeEnd += OnEditorPlayModeChanged;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -100,18 +100,17 @@ namespace Cabrito
|
||||
|
||||
#if FLAX_EDITOR
|
||||
ScriptsBuilder.ScriptsReload -= Destroy;
|
||||
Editor.Instance.StateMachine.StateChanged -= OnEditorStateChanged;
|
||||
Editor.Instance.PlayModeEnd -= OnEditorPlayModeChanged;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if FLAX_EDITOR
|
||||
private static void OnEditorStateChanged()
|
||||
private static void OnEditorPlayModeChanged()
|
||||
{
|
||||
if (!Editor.Instance.StateMachine.IsPlayMode)
|
||||
// Clear console buffer when leaving play mode
|
||||
if (instance != null)
|
||||
Clear();
|
||||
// Clear console buffer when leaving play mode
|
||||
if (instance != null)
|
||||
Clear();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user