gamemode spawning

This commit is contained in:
2022-05-05 20:10:43 +03:00
parent fe443b9f50
commit c4f5d4d4d2
9 changed files with 101 additions and 45 deletions

View File

@@ -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