Ejemplo n.º 1
0
        void StartTutorialImmediateEditMode()
        {
            if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
            {
                return;
            }

            // Prevent Game view flashing briefly when starting tutorial.
            EditorWindow.GetWindow <SceneView>().Focus();

            SaveOriginalScenes();
            SaveOriginalWindowLayout();
            SaveSceneViewState();

            m_Tutorial.LoadWindowLayout();

            // Ensure TutorialWindow is open and set the current tutorial
            var tutorialWindow = EditorWindow.GetWindow <TutorialWindow>();

            tutorialWindow.SetTutorial(m_Tutorial, false);

            m_Tutorial.ResetProgress();

            // Do not overwrite workspace in authoring mode, use version control instead.
            if (!ProjectMode.IsAuthoringMode())
            {
                LoadTutorialDefaultsIntoAssetsFolder();
            }
        }
Ejemplo n.º 2
0
        void StartTutorialInEditMode()
        {
            // TODO HACK double delay to resolve various issue (e.g. black screen during save modifications dialog
            // Revisit and fix properly.
            EditorApplication.delayCall += delegate
            {
                EditorApplication.delayCall += delegate
                {
                    if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
                    {
                        return;
                    }

                    // TODO document why this is done
                    EditorWindow.GetWindow <SceneView>().Focus();

                    SaveOriginalScenes();
                    SaveOriginalWindowLayout();

                    m_Tutorial.LoadWindowLayout();

                    // Ensure TutorialWindow is open and set the current tutorial
                    var tutorialWindow = EditorWindow.GetWindow <TutorialWindow>();
                    tutorialWindow.SetTutorial(m_Tutorial);

                    m_Tutorial.ResetProgress();

                    // Do not overwrite workspace in authoring mode, use version control instead.
                    if (!ProjectMode.IsAuthoringMode())
                    {
                        LoadTutorialDefaultsIntoAssetsFolder();
                    }
                };
            };
        }
Ejemplo n.º 3
0
        void StartTutorialInEditMode()
        {
            if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
            {
                return;
            }

            // Postpone start of tutorial until window is closed
            var tutorialWindow = GetTutorialWindow();

            if (tutorialWindow != null)
            {
                tutorialWindow.Close();
                AfterWindowClosed += StartTutorialInEditMode;
                return;
            }

            AfterWindowClosed -= StartTutorialInEditMode;

            SaveOriginalScenes();
            SaveOriginalWindowLayout();

            m_Tutorial.LoadWindowLayout();

            // Ensure TutorialWindow is open and set the current tutorial
            tutorialWindow = EditorWindow.GetWindow <TutorialWindow>();
            tutorialWindow.SetTutorial(m_Tutorial);

            m_Tutorial.ResetProgress();

            // Do not overwrite workspace in authoring mode, use version control instead.
            if (!ProjectMode.IsAuthoringMode())
            {
                LoadTutorialDefaultsIntoAssetsFolder();
            }
        }
Ejemplo n.º 4
0
        internal void SetTutorial(Tutorial tutorial, bool reload = true)
        {
            ClearTutorialListener();

            m_CurrentTutorial = tutorial;
            if (m_CurrentTutorial != null)
            {
                if (reload)
                {
                    m_CurrentTutorial.ResetProgress();
                }
                m_AllParagraphs.Clear();
                m_Paragraphs.Clear();
            }
            SetUpTutorial();
        }
Ejemplo n.º 5
0
        internal void SetTutorial(Tutorial tutorial, bool reload)
        {
            ClearTutorialListener();

            currentTutorial = tutorial;
            if (currentTutorial != null)
            {
                if (reload)
                {
                    currentTutorial.ResetProgress();
                }
                m_AllParagraphs.Clear();
                m_Paragraphs.Clear();
            }

            ApplyMaskingSettings(currentTutorial != null);

            SetUpTutorial();
        }