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)
    {
        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;
        }
    }
示例#3
0
        private void Start()
        {
            _exampleSceneLoader = FindObjectOfType <ExampleSceneLoader>();

            _startGameButton.onClick.AddListener(StartButtonFunction);
            _scoreBoardButton.onClick.AddListener(ScoreBoardButtonFunction);
            _settingsButton.onClick.AddListener(SettingsButtonFunction);
            _creditsButton.onClick.AddListener(CreditsButtonFunction);

            UIManager.Instance().currentUIPanelController = this;
        }
示例#4
0
    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);
        }
    }
 private void Start()
 {
     _exampleSceneLoader = FindObjectOfType <ExampleSceneLoader>();
 }