Beispiel #1
0
 private void    DisplayBrokenTutorialHelper(string title)
 {
     if (GUI.Button(r, "Tutorial \"" + title + "\" is broken, due to missing module. Please contact the author.") == true)
     {
         // Force the wizard to be unique.
         ScriptableWizard.GetWindow(this.ContactFormWizardType).Close();
         ScriptableWizard.DisplayWizard(string.Empty, this.ContactFormWizardType);
     }
 }
Beispiel #2
0
        public static void      Open(Subject subject, string tool, string complementaryInformation)
        {
            ScriptableWizard.GetWindow <ContactFormWizard>().Close();
            ContactFormWizard wizard = ScriptableWizard.DisplayWizard <ContactFormWizard>(Constants.PackageTitle);

            wizard.subject = subject;
            wizard.complementaryInformation = complementaryInformation;
            wizard.specificTools            = tool;
        }
Beispiel #3
0
        public static void      Import(string file)
        {
            Node root = new Node(null, string.Empty);

            using (StreamReader sr = new StreamReader(file))
                using (BinaryReader br = new BinaryReader(sr.BaseStream))
                {
                    root.Deserialize(br);
                }

            ImportSettingsWizard isw = ScriptableWizard.GetWindow <ImportSettingsWizard>(true, "Import Settings", true);

            isw.Init(root);
            //OutputNode(root);
        }
Beispiel #4
0
        protected virtual void  OnGUI()
        {
            if (this.centeredTextField == null)
            {
                this.centeredTextField           = new GUIStyle(GUI.skin.textField);
                this.centeredTextField.alignment = TextAnchor.MiddleCenter;
                this.centeredLabel           = new GUIStyle(GUI.skin.label);
                this.centeredLabel.alignment = TextAnchor.MiddleCenter;
            }

            if (this.NGConsoleType == null)
            {
                this.fullScreenRect.x      = 0F;
                this.fullScreenRect.y      = 0F;
                this.fullScreenRect.width  = Screen.width;
                this.fullScreenRect.height = Screen.height;
                if (GUI.Button(this.fullScreenRect, "The NG Console tutorial is encountering issues. Contact the author and tell him that it is broken.", this.centeredLabel) == true)
                {
                    // Force the wizard to be unique.
                    ScriptableWizard.GetWindow(this.ContactFormWizardType).Close();
                    ScriptableWizard.DisplayWizard(string.Empty, this.ContactFormWizardType);
                }
                return;
            }

            if (TestUtility.RequireUnmaximized() == true)
            {
                return;
            }

            this.r.x     = TestLoggers.XOffset;
            this.r.y     = TestLoggers.YOffset;
            this.r.width = Screen.width - this.r.x - this.r.x;

            Object[] instances = Resources.FindObjectsOfTypeAll(NGConsoleType);

            if (instances.Length == 0)
            {
                if (GUI.Button(r, "Open NG Console before starting the tutorial") == true)
                {
                    EditorApplication.ExecuteMenuItem("Window/" + Constants.PackageTitle + "/NG Console");
                }
                return;
            }

            this.NGConsoleInstance = instances[0];

            if (this.SettingsFieldInfo != null)
            {
                if (this.SettingsFieldInfo.GetValue(this.NGConsoleInstance) == null)
                {
                    this.fullScreenRect.x      = 0F;
                    this.fullScreenRect.y      = 0F;
                    this.fullScreenRect.width  = Screen.width;
                    this.fullScreenRect.height = Screen.height;
                    GUI.Label(this.fullScreenRect, "NG Console requires an instance of NGSetting to run. Go to the console and link it to one.", this.centeredLabel);
                    return;
                }
            }

            this.DrawTestLoggers();
        }