void OnPlayStateChanged(PlayModeStateChange state) { previousSelectedGameObject = null; if (state == PlayModeStateChange.EnteredEditMode) { ResetInstances(); ScriptDataService.CloseCurrentConstellationInstance(); if (ScriptDataService.OpenedScripts.Count > 0) { Open(ScriptDataService.OpenedScripts[0]); } } if (state == PlayModeStateChange.ExitingEditMode) { ScriptDataService.RefreshConstellationEditorDataList(); ParseScript(); } if (ScriptDataService.GetEditorData().ExampleData.openExampleConstellation&& state == PlayModeStateChange.EnteredPlayMode) { var nodeExampleLoader = new ExampleSceneLoader(); nodeExampleLoader.RunExample(ScriptDataService.GetEditorData().ExampleData.constellationName, ScriptDataService); ScriptDataService.GetEditorData().ExampleData.openExampleConstellation = false; } }
void OnPlayStateChanged(PlayModeStateChange state) { /*WindowInstance.RequestSetup(); * WindowInstance.previousSelectedGameObject = null;*/ previousSelectedGameObject = null; if (state == PlayModeStateChange.EnteredEditMode) { ResetInstances(); Open(ScriptDataService.currentPath[0]); } if (state == PlayModeStateChange.ExitingEditMode && !ScriptDataService.GetEditorData().ExampleData.openExampleConstellation) { ParseScript(); } if (ScriptDataService.GetEditorData().ExampleData.openExampleConstellation&& state == PlayModeStateChange.EnteredPlayMode) { var nodeExampleLoader = new ExampleSceneLoader(); nodeExampleLoader.RunExample(ScriptDataService.GetEditorData().ExampleData.constellationName, ScriptDataService); ScriptDataService.GetEditorData().ExampleData.openExampleConstellation = false; } /*EditorApplication.playModeStateChanged -= OnPlayStateChanged; * WindowInstance.RequestRepaint();*/ }
void OnPlayStateChanged(PlayModeStateChange state) { try { Selection.objects = new Object[0]; previousSelectedGameObject = null; if (IsConstellationSelected()) { if (state == PlayModeStateChange.EnteredEditMode) { ResetInstances(); ScriptDataService.CloseCurrentConstellationInstance(); if (ScriptDataService.OpenedScripts.Count > 0) { Open(ScriptDataService.OpenedScripts[0]); } } if (state == PlayModeStateChange.ExitingEditMode) { ScriptDataService.RefreshConstellationEditorDataList(); ParseScript(); } if (ScriptDataService.GetEditorData().ExampleData.openExampleConstellation&& state == PlayModeStateChange.EnteredPlayMode) { var nodeExampleLoader = new ExampleSceneLoader(); nodeExampleLoader.RunExample(ScriptDataService.GetEditorData().ExampleData.constellationName, ScriptDataService); ScriptDataService.GetEditorData().ExampleData.openExampleConstellation = false; } } }catch (System.Exception exception) { UnexpectedError(exception.StackTrace); } }