Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="scene"></param>
        static void HandleSceneChanged(Scene scene)
        {
            //search the scene for out 'Tutorial' object and get the tutorial info
            var tutorial = GameObject.FindObjectOfType <TutorialPages>();

            if (tutorial != null)
            {
                TutorialWindow.ShowWindow(tutorial.PageText);
            }
            else
            {
                TutorialWindow.ShowWindow(null);
            }
        }
Пример #2
0
        //string PropertyPingTarget;

        /// <summary>
        ///
        /// </summary>
        /// <param name="pageText"></param>
        /// <returns></returns>
        public static TutorialWindow ShowWindow(string[] pageText)
        {
            TutorialWindow window = EditorWindow.GetWindow(typeof(TutorialWindow), true, "PGI Tutorial") as TutorialWindow;

            window.PageText = new List <string>(pageText);
            window.Page     = 0;
            if (window.PageText.Count > 0)
            {
                window.CurrentPageText = window.ProcessPage(window.PageText[0]);
            }

            //setup the style of the text
            window.TextStyle          = EditorStyles.textArea;
            window.TextStyle.richText = true;
            window.TextStyle.padding  = new RectOffset(5, 5, 10, 20);
            window.TextStyle.fontSize = 12;
            window.TextStyle.wordWrap = true;
            return(window);
        }