예제 #1
0
        IEnumerator GoToNextPageAfterDelay()
        {
            //TODO WaitForSecondsRealtime();
            float seconds = 0.5f;

            while (seconds > 0f)
            {
                seconds -= Time.deltaTime;
                yield return(null);
            }
            if (currentTutorial.TryGoToNextPage())
            {
                UpdateNextButton();
                yield break;
            }
            ApplyMaskingSettings(true);
        }
예제 #2
0
        void OnTutorialPageCriteriaCompletionStateTested(TutorialPage sender)
        {
            if (m_CurrentTutorial == null || m_CurrentTutorial.currentPage != sender)
            {
                return;
            }

            foreach (var paragraph in m_Paragraphs)
            {
                paragraph.ResetState();
            }

            if (sender.allCriteriaAreSatisfied && sender.autoAdvanceOnComplete && !sender.hasMovedToNextPage)
            {
                if (m_CurrentTutorial.TryGoToNextPage())
                {
                    return;
                }
            }

            ApplyMaskingSettings(true);
        }
예제 #3
0
        public void StartTutorial(Tutorial tutorial)
        {
            if (tutorial == null)
            {
                Debug.LogError("Null Tutorial.");
                return;
            }

            // Early-out if user decides to cancel. Otherwise the user can get reset to the
            // main tutorial selection screen in cases where the user was about to swtich to
            // another tutorial while finishing up another (typical use case would be having a
            // "start next tutorial" button at the last page of a tutorial).
            if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
            {
                return;
            }

            // NOTE maximizeOnPlay=true was causing problems at some point
            // (tutorial was closed for some reason) but that problem seems to be gone.
            // Keeping this here in case the problem returns.
            //GameViewProxy.maximizeOnPlay = false;

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

            // Is the previous tutorial finished? Make sure to record the progress.
            // by trying to progress to the next page which will take care of it.
            if (m_Tutorial && m_Tutorial.completed)
            {
                m_Tutorial.TryGoToNextPage();
            }

            m_Tutorial = tutorial;

            // Ensure we are in edit mode
            if (EditorApplication.isPlaying)
            {
                EditorApplication.isPlaying             = false;
                EditorApplication.playModeStateChanged += PostponeStartTutorialToEditMode;
            }
            else
            {
                StartTutorialImmediateEditMode();
            }
        }
예제 #4
0
        void AutoCompleteNextIncompleteCriterion()
        {
            m_Continue = false;

            while (m_Tutorial.TryGoToNextPage())
            {
            }

            var nextIncompleteCriterion = GetNextIncompleteCriterion();

            if (nextIncompleteCriterion == null)
            {
                Stop();
                return;
            }

            if (!nextIncompleteCriterion.AutoComplete())
            {
                Debug.LogWarning("Unable to complete criterion automatically");
                Stop();
            }

            m_CompletionDeadline = EditorApplication.timeSinceStartup + k_TimeoutDuration;
        }
예제 #5
0
        public void StartTutorial(Tutorial tutorial)
        {
            if (tutorial == null)
            {
                Debug.LogError("Null Tutorial.");
                return;
            }

            // NOTE maximizeOnPlay=true was causing problems at some point
            // (tutorial was closed for some reason) but that problem seems to be gone.
            // Keeping this here in case the problem returns.
            //GameViewProxy.maximizeOnPlay = false;

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

            // Is the previous tutorial finished? Make sure to record the progress.
            // by trying to progress to the next page which will take care of it.
            if (m_Tutorial && m_Tutorial.completed)
            {
                m_Tutorial.TryGoToNextPage();
            }

            m_Tutorial = tutorial;

            // Ensure we are in edit mode
            if (EditorApplication.isPlaying)
            {
                EditorApplication.isPlaying             = false;
                EditorApplication.playModeStateChanged += PostponeStartTutorialToEditMode;
            }
            else
            {
                StartTutorialInEditMode();
            }
        }