Esempio n. 1
0
 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);
         }
     }
 }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        /// <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();
        }
Esempio n. 5
0
        /// <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();
            }
        }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 7
0
 public void IsTutorialStep(int tutorialStepNumber, TutorialStepDelegate StepDelegate, ColorBoxType boxType = ColorBoxType.Tutorial)
 {
     IsTutorialStep(tutorialStepNumber, true, StepDelegate, boxType);
 }
Esempio n. 8
0
 /// <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);
 }
Esempio n. 9
0
 /// <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);
 }