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); }
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); }
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(); } }
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; }
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(); } }