Play scene if invalid first scene data in editor while selected to play game from first scene.

This commit is contained in:
Chandler Cox
2024-05-22 14:38:17 -05:00
parent c486577b07
commit 8e4783a0c6

View File

@@ -127,9 +127,7 @@ namespace FlaxEditor.Modules
public void RequestStartPlayGame()
{
if (!Editor.StateMachine.IsEditMode)
{
return;
}
var firstScene = Content.Settings.GameSettings.Load().FirstScene;
if (firstScene == Guid.Empty)
@@ -141,6 +139,9 @@ namespace FlaxEditor.Modules
if (!FlaxEngine.Content.GetAssetInfo(firstScene.ID, out var info))
{
Editor.LogWarning("Invalid First Scene in Game Settings.");
if (Level.IsAnySceneLoaded)
Editor.Simulation.RequestStartPlayScenes();
return;
}
// Load scenes after entering the play mode