Пример #1
0
        public static void      Invoke(string name, Type type, string staticMethod)
        {
            if (type != null)
            {
                MethodInfo method = type.GetMethod(staticMethod, BindingFlags.Public | BindingFlags.Static);

                if (method != null)
                {
                    method.Invoke(null, null);
                    return;
                }
            }

            if (HQ.nestedMenuFailedOnce == name)
            {
                Utility.ShowPreferencesWindowAt(Constants.PreferenceTitle);
                Preferences.tab = Preferences.Tab.Preferences;
                XGUIHighlightManager.Highlight(Preferences.Title + ".RootedMenu");
            }
            else
            {
                HQ.nestedMenuFailedOnce = name;
                InternalNGDebug.LogWarning("Calling MenuItem \"" + name + "\" has failed. Please regenerate rooted menu. (Go to Edit/Preferences/NG Tools or recall this menu)");
            }
        }
Пример #2
0
        public static void      DrawHighlight(string id, EditorWindow window, Rect r, Highlights highlights)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            XGUIHighlightManager.DrawHighlight(id, window, r, true, highlights);
        }
Пример #3
0
        public static void      DrawHighlightLayout(string id, EditorWindow window, bool canCancel, Highlights highlights = XGUIHighlightManager.Highlights.Glow | Highlights.Wave)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            XGUIHighlightManager.DrawHighlight(id, window, GUILayoutUtility.GetLastRect(), canCancel);
        }
Пример #4
0
        protected virtual void  OnGUI()
        {
            GUILayout.Label(@"In order to get full power from NG Tools, you need to activate licenses to remove limitations.

An ""NG Tools Pro"" license will remove all limitations.

Any other license will grant full power to only the tool that it is related.");

            GUILayout.Space(15F);

            GUILayout.Label("1. Get the invoice.", GeneralStyles.Title1);

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label("Go to your Order History in the Asset Store.");

                if (GUILayout.Button("Go to Asset Store orders") == true)
                {
                    Help.BrowseURL("https://assetstore.unity.com/orders");
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Label("Top-right corner picture in the Asset Store, then \"<b>My Orders</b>\".", GeneralStyles.RichLabel);

            GUILayout.Space(10F);

            GUILayout.Label("Find your purchase line, then look for column \"<b>Invoice Number</b>\".", GeneralStyles.RichLabel);
            GUILayout.Label(@"It might be empty, Unity can require time to generate it.
If it is not appearing, please contact them directly.");

            GUILayout.Space(10F);

            GUILayout.Label("If you urgently need the license to work, contact me through the following medium:");

            EditorGUILayout.BeginHorizontal();
            {
                if (GUILayout.Button(Preferences.DiscordContent, GeneralStyles.BigButton, GUILayoutOptionPool.Height(40F)) == true)
                {
                    Application.OpenURL(Constants.DiscordURL);
                }

                if (GUILayout.Button(Preferences.UnityForumContent, GeneralStyles.BigButton, GUILayoutOptionPool.Height(40F)) == true)
                {
                    Application.OpenURL(Constants.SupportForumUnityThread);
                }

                if (GUILayout.Button(LC.G("Preferences_Contact"), GeneralStyles.BigButton, GUILayoutOptionPool.Height(40F)) == true)
                {
                    ContactFormWizard.Open(ContactFormWizard.Subject.Contact);
                }
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10F);

            GUILayout.Label("2. Check invoice.", GeneralStyles.Title1);

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label("Go back to Preferences > NG Tools > Licenses.");

                if (GUILayout.Button("Go") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label("Write your invoice in the input at the bottom and add it.");

                if (GUILayout.Button("Highlight") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;
                    XGUIHighlightManager.Highlight(Preferences.Title + ".AddInvoice");
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(@"Then you need to check it, to ensure NG Tools recognizes it as a valid license.");

                if (GUILayout.Button("Highlight") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;

                    bool hasUncheckedLicense = false;

                    foreach (License i in NGLicenses.NGLicensesManager.EachInvoices())
                    {
                        if (i.status == Status.Unknown)
                        {
                            hasUncheckedLicense = true;
                            break;
                        }
                    }

                    if (hasUncheckedLicense == true)
                    {
                        XGUIHighlightManager.Highlight(Preferences.Title + ".CheckLicense");
                    }
                    else
                    {
                        EditorUtility.DisplayDialog(Constants.PackageTitle, "You must first add invoice prior to check it.", "OK");
                    }
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10F);

            GUILayout.Label("3. Activate license.", GeneralStyles.Title1);

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(@"If the license is valid, its associated asset will be displayed.
Otherwise, it will show ""Invalid"" in grey letters.
Now you can activate it.");

                if (GUILayout.Button("Highlight") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;

                    bool hasValidLicense = false;

                    foreach (License i in NGLicenses.NGLicensesManager.EachInvoices())
                    {
                        if (i.status == Status.Valid)
                        {
                            hasValidLicense = true;
                            break;
                        }
                    }

                    if (hasValidLicense == true)
                    {
                        XGUIHighlightManager.Highlight(Preferences.Title + ".ActivateLicense");
                    }
                    else
                    {
                        EditorUtility.DisplayDialog(Constants.PackageTitle, "You must first check an invoice prior to validate it.", "OK");
                    }
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10F);

            GUILayout.Label("4. Manage seats.", GeneralStyles.Title1);

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(@"You can verifiy seats associated with your licenses.
And revoke them as it fits you.");

                if (GUILayout.Button("Highlight") == true)
                {
                    Utility.ShowPreferencesWindowAt(Constants.PackageTitle, "Licenses");
                    Preferences.tab = Preferences.Tab.Licenses;

                    bool hasValidLicense = false;

                    foreach (License i in NGLicenses.NGLicensesManager.EachInvoices())
                    {
                        if (i.status == Status.Valid)
                        {
                            hasValidLicense = true;
                            break;
                        }
                    }

                    if (hasValidLicense == true)
                    {
                        XGUIHighlightManager.Highlight(Preferences.Title + ".CheckSeats");
                    }
                    else
                    {
                        EditorUtility.DisplayDialog(Constants.PackageTitle, "You must first check an invoice prior to manage its seats.", "OK");
                    }
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(@"If you are encountering issues with seats, please contact me directly.

If you require a license without the 2 seats limitation, please contact me directly.");

                if (GUILayout.Button(LC.G("Preferences_Contact"), GUILayoutOptionPool.ExpandHeightTrue) == true)
                {
                    ContactFormWizard.Open(ContactFormWizard.Subject.Contact);
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(5F);

            EditorGUILayout.HelpBox("A license is an invoice.", MessageType.Info);
            EditorGUILayout.HelpBox("You can activate a license on 2 seats maximum! \"2 seats\" means 2 computers, implying many projects on those 2 computers, as much as you want.", MessageType.Info);

            if (this.preferencesWindow != null)
            {
                this.preferencesWindow.Repaint();
            }
        }