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