public void IsTutorialStep(int[] indices, TutorialStepDelegate StepDelegate, ColorBoxType boxType = ColorBoxType.Tutorial) { for (int i = 0; i < indices.Length; i++) { if (indices[i] == CurrentTutorialIndex) { IsTutorialStep(CurrentTutorialIndex, StepDelegate, boxType); } } }
public void IsTutorialStep(bool ShouldDisplayTutorial, TutorialStepDelegate StepDelegate) { //If we're in a tutorial OR if we always want to draw the box. ShouldDisplayTutorial = TutorialModeActive && ShouldDisplayTutorial; if (ShouldDisplayTutorial) { TutorialStepBox(StepDelegate); } }
public void IsTutorialStep(TutorialStepDelegate StepDelegate, bool forceTutorialBoxDraw = false) { bool ShouldDisplayTutorial = false; //If we're in a tutorial OR if we always want to draw the box. ShouldDisplayTutorial = TutorialModeActive || forceTutorialBoxDraw; if (ShouldDisplayTutorial) { TutorialStepBox(StepDelegate); } }
/// <summary> /// Draws the actual tutorial box content. /// Does not check if it should or shouldn't display. Call IsTutorialStep instead. /// </summary> /// <param name="StepDelegate">The content to execute when this tutorial box is displayed</param> /// <param name="tutorialStepNumber">-1 will not show step number information</param> public void TutorialStepBox(TutorialStepDelegate StepDelegate, int tutorialStepNumber = -1, ColorBoxType boxType = ColorBoxType.Tutorial) { EditorGUILayout.BeginVertical("Box"); EditorGUILayout.BeginVertical(NSEditorStyles.GetColoredHelpBoxStyle(boxType)); StepDelegate(); if (tutorialStepNumber != -1) { EditorGUILayout.BeginHorizontal(); NSEditorStyles.DrawLabel("[" + tutorialStepNumber + "]"); EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical(); }
/// <summary> /// This function ALWAYS calls the StepDelegate, but highlights the Delegate Element when told too. /// Will not highlight outside of tutorial mode /// </summary> /// <param name="shouldHighlight"></param> /// <param name="StepDelegate"></param> /// <param name="boxType"></param> public void TutorialHighlight(bool shouldHighlight, TutorialStepDelegate StepDelegate, ColorBoxType boxType = ColorBoxType.Tutorial) { if (shouldHighlight && TutorialModeActive) { //EditorGUILayout.BeginVertical("Box"); EditorGUILayout.BeginVertical(NSEditorStyles.GetColoredHelpBoxStyle(boxType)); } StepDelegate(); if (shouldHighlight && TutorialModeActive) { //EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical(); } }
public void IsTutorialStep(int tutorialStepNumber, bool ShouldDisplayTutorial, TutorialStepDelegate StepDelegate, ColorBoxType boxType = ColorBoxType.Tutorial) { bool returnVal = false; if (CurrentTutorialIndex == tutorialStepNumber) { //Draw tutorial content. returnVal = true; } if (tutorialStepNumber > LargestTutorialIndex) { LargestTutorialIndex = tutorialStepNumber; } if (!TutorialModeActive) { returnVal = false; } if (returnVal && ShouldDisplayTutorial) { TutorialStepBox(StepDelegate, tutorialStepNumber, boxType); } }
public void IsTutorialStep(int tutorialStepNumber, TutorialStepDelegate StepDelegate, ColorBoxType boxType = ColorBoxType.Tutorial) { IsTutorialStep(tutorialStepNumber, true, StepDelegate, boxType); }
/// <summary> /// This function ALWAYS calls the StepDelegate, but highlights the Delegate Element during the indicated step. /// Only highlights when it is BOTH that step and shouldHightlight is true. /// </summary> /// <param name="tutorialStepNumber"></param> /// <param name="shouldHightlight"></param> /// <param name="StepDelegate"></param> /// <param name="boxType"></param> public void TutorialHighlight(int tutorialStepNumber, bool shouldHightlight, TutorialStepDelegate StepDelegate, ColorBoxType boxType = ColorBoxType.Tutorial) { TutorialHighlight(IsTutorialStep(tutorialStepNumber) && shouldHightlight, StepDelegate, boxType); }
/// <summary> /// This function ALWAYS calls the StepDelegate, but highlights the Delegate Element during tutorials /// </summary> /// <param name="StepDelegate"></param> /// <param name="boxType"></param> public void TutorialHighlight(TutorialStepDelegate StepDelegate, ColorBoxType boxType = ColorBoxType.Tutorial) { TutorialHighlight(TutorialModeActive, StepDelegate, boxType); }