Example #1
0
        private void OnGUI()
        {
            // Draw header area
            SRDebugEditorUtil.BeginDrawBackground();
            SRDebugEditorUtil.DrawLogo(SRDebugEditorUtil.GetWelcomeLogo());
            SRDebugEditorUtil.EndDrawBackground();

            // Draw header/content divider
            EditorGUILayout.BeginVertical(SRDebugEditorUtil.Styles.SettingsHeaderBoxStyle);
            EditorGUILayout.EndVertical();

            _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);

            GUILayout.Label("Welcome", SRDebugEditorUtil.Styles.HeaderLabel);

            GUILayout.Label(
                "Thank you for purchasing SRDebugger, your support is very much appreciated and we hope you find it useful for your project. " +
                "This window contains a quick guide to get to help get you started with SRDebugger.",
                SRDebugEditorUtil.Styles.ParagraphLabel);

            if (SRDebugEditorUtil.ClickableLabel(
                    "Note: For more detailed information <color={0}>click here</color> to visit the online documentation."
                    .Fmt(SRDebugEditorUtil.Styles.LinkColour),
                    SRDebugEditorUtil.Styles.ParagraphLabel))
            {
                Application.OpenURL(SRDebugStrings.Current.SettingsDocumentationUrl);
            }


#if UNITY_5_3
            EditorGUILayout.HelpBox(
                "On Unity 5.3 and 5.3.1 there is a bug causing errors to be printed to the console when using the docked tools. This should be fixed in a future Unity update.",
                MessageType.Warning, true);
#endif

            GUILayout.Label("Quick Start", SRDebugEditorUtil.Styles.HeaderLabel);

#if UNITY_5
            GUILayout.Label(
                "Now that you have imported the package, you should find the trigger available in the top-left of your game window when in play mode. " +
                "Triple-clicking this trigger will bring up the debug panel. The trigger is hidden until clicked.",
                SRDebugEditorUtil.Styles.ParagraphLabel);

            GUILayout.Label(
                "By default, SRDebugger loads automatically when your game starts. " +
                "You can change this behaviour from the SRDebugger Settings window.",
                SRDebugEditorUtil.Styles.ParagraphLabel);
#else
            GUILayout.Label(
                "Drag the <b>SRDebugger.Init</b> prefab into the first scene of your game. " +
                "Once initialised, SRDebugger will be available even after loading new scenes. We recommend adding the SRDebugger.Init prefab to the first scene " +
                "of your game so that the debug panel is available in all subsequent scenes.",
                SRDebugEditorUtil.Styles.ParagraphLabel);

            GUILayout.Label(
                "Once the prefab is in your scene, you should find the trigger available in the top-left of your game window when in play mode. " +
                "Triple-clicking this trigger will bring up the debug panel. The trigger is hidden until clicked.",
                SRDebugEditorUtil.Styles.ParagraphLabel);
#endif

            DrawVideo();

            EditorGUILayout.Space();

            GUILayout.Label("Customization", SRDebugEditorUtil.Styles.HeaderLabel);

            if (SRDebugEditorUtil.ClickableLabel(
                    "Many features of SRDebugger can be configured from the <color={0}>SRDebugger Settings</color> window."
                    .Fmt(
                        SRDebugEditorUtil.Styles.LinkColour), SRDebugEditorUtil.Styles.ParagraphLabel))
            {
                SRDebuggerSettingsWindow.Open();
            }

            GUILayout.Label(
                "From the settings window you can configure loading behaviour, trigger position, docked tools layout, and more. " +
                "You can enable the bug reporter service by using the sign-up form to get a free API key.",
                SRDebugEditorUtil.Styles.ParagraphLabel);

            GUILayout.Label("What Next?", SRDebugEditorUtil.Styles.HeaderLabel);

            if (SRDebugEditorUtil.ClickableLabel(
                    "For more detailed information about SRDebugger's features or details about the Options Tab and script API, check the <color={0}>online documentation</color>."
                    .Fmt(SRDebugEditorUtil.Styles.LinkColour), SRDebugEditorUtil.Styles.ParagraphLabel))
            {
                Application.OpenURL(SRDebugStrings.Current.SettingsDocumentationUrl);
            }

            GUILayout.Label(
                "Thanks again for purchasing SRDebugger. " +
                "If you find it useful please consider leaving a rating or review on the Asset Store page to help us spread the word. ",
                SRDebugEditorUtil.Styles.ParagraphLabel);

            GUILayout.Label(
                "If you have any questions or concerns please do not hesitate to get in touch with us via email or the Unity forums.",
                SRDebugEditorUtil.Styles.ParagraphLabel);

            SRDebugEditorUtil.DrawFooterLayout(Screen.width - 15);

            EditorGUILayout.EndScrollView();

            Repaint();
        }
Example #2
0
        private void DrawBugReportSignupForm()
        {
            var isWeb = false;

#if UNITY_WEBPLAYER
            EditorGUILayout.HelpBox("Signup form is not available when build target is Web Player.", MessageType.Error);
            isWeb = true;
#endif

            EditorGUI.BeginDisabledGroup(isWeb || !_enableTabChange);

            GUILayout.Label("Signup Form", SRDebugEditorUtil.Styles.HeaderLabel);
            GUILayout.Label(
                "SRDebugger requires a free API key to enable the bug reporter system. This form will acquire one for you.",
                SRDebugEditorUtil.Styles.ParagraphLabel);

            if (
                SRDebugEditorUtil.ClickableLabel(
                    "Already got an API key? <color={0}>Click here</color>.".Fmt(SRDebugEditorUtil.Styles.LinkColour),
                    SRDebugEditorUtil.Styles.RichTextLabel))
            {
                _showBugReportSignupForm = false;
                Repaint();
            }

            EditorGUILayout.Space();

            GUILayout.Label("Invoice Number", EditorStyles.boldLabel);

            GUILayout.Label(
                "Enter the invoice number from your Asset Store purchase invoice.",
                EditorStyles.miniLabel);

            _invoiceNumber = EditorGUILayout.TextField(_invoiceNumber);

            EditorGUILayout.Space();

            GUILayout.Label("Email Address", EditorStyles.boldLabel);

            GUILayout.Label(
                "Provide an email address where the bug reports should be sent.",
                EditorStyles.miniLabel);

            _emailAddress = EditorGUILayout.TextField(_emailAddress);

            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();

            if (SRDebugEditorUtil.ClickableLabel(
                    "I agree to the <color={0}>terms and conditions</color>.".Fmt(SRDebugEditorUtil.Styles.LinkColour),
                    SRDebugEditorUtil.Styles.RichTextLabel))
            {
                ApiSignupTermsWindow.Open();
            }

            _agreeLegal = EditorGUILayout.Toggle(_agreeLegal);

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            var isEnabled = !string.IsNullOrEmpty(_invoiceNumber) && !string.IsNullOrEmpty(_emailAddress) && _agreeLegal;
            EditorGUI.BeginDisabledGroup(!isEnabled);

            if (GUILayout.Button("Submit"))
            {
                _errorMessage    = null;
                _enableTabChange = false;

                EditorApplication.delayCall += () =>
                {
                    ApiSignup.SignUp(_emailAddress, _invoiceNumber, OnSignupResult);
                    Repaint();
                };
            }

            EditorGUI.EndDisabledGroup();

            if (!string.IsNullOrEmpty(_errorMessage))
            {
                EditorGUILayout.HelpBox(_errorMessage, MessageType.Error, true);
            }

            GUILayout.FlexibleSpace();

            GUILayout.Label("Having trouble? Please email [email protected] for assistance.",
                            EditorStyles.miniLabel);

            EditorGUI.EndDisabledGroup();
        }