예제 #1
0
        private void DrawBugReporterArea()
        {
            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.PropertyField(_apiKeyProperty);

            if (GUILayout.Button("Verify", GUILayout.ExpandWidth(false)))
            {
                EditorUtility.DisplayDialog("Verify API Key", ApiSignup.Verify(_apiKeyProperty.stringValue), "OK");
            }

            EditorGUILayout.EndHorizontal();

            GUI.enabled = !string.IsNullOrEmpty(_apiKeyProperty.stringValue);

            EditorGUILayout.PropertyField(_enableBugReporterProperty);

            GUI.enabled = true;

            if (GUILayout.Button("Need API Key?"))
            {
                ApiSignupWindow.Open();
            }
        }
예제 #2
0
        private void DrawTabBugReporter()
        {
            if (_showBugReportSignupForm)
            {
                DrawBugReportSignupForm();
                return;
            }

            GUILayout.Label("Bug Reporter", SRDebugEditorUtil.Styles.HeaderLabel);

            EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(Settings.Instance.ApiKey));

            Settings.Instance.EnableBugReporter = EditorGUILayout.Toggle("Enable Bug Reporter",
                                                                         Settings.Instance.EnableBugReporter);

            EditorGUI.EndDisabledGroup();

            EditorGUILayout.BeginHorizontal();

            Settings.Instance.ApiKey = EditorGUILayout.TextField("API Key", Settings.Instance.ApiKey);

            if (GUILayout.Button("Verify", GUILayout.ExpandWidth(false)))
            {
                EditorUtility.DisplayDialog("Verify API Key", ApiSignup.Verify(Settings.Instance.ApiKey), "OK");
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            GUILayout.Label(
                "If you need to change your account email address, or have any other questions or concerns, please email us at [email protected].",
                SRDebugEditorUtil.Styles.ParagraphLabel);

            GUILayout.FlexibleSpace();

            if (!string.IsNullOrEmpty(Settings.Instance.ApiKey))
            {
                GUILayout.Label("Reset", SRDebugEditorUtil.Styles.InspectorHeaderStyle);
                GUILayout.Label("Click the button below to clear the API key and show the signup form.",
                                SRDebugEditorUtil.Styles.ParagraphLabel);

                EditorGUILayout.BeginHorizontal();

                _enableButton = EditorGUILayout.Toggle("Enable Button", _enableButton, GUILayout.ExpandWidth(false));

                EditorGUI.BeginDisabledGroup(!_enableButton);

                if (GUILayout.Button("Reset"))
                {
                    Settings.Instance.ApiKey            = null;
                    Settings.Instance.EnableBugReporter = false;
                    _enableButton            = false;
                    _showBugReportSignupForm = true;
                }

                EditorGUI.EndDisabledGroup();

                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();
            }
            else
            {
                if (GUILayout.Button("Show Signup Form"))
                {
                    _showBugReportSignupForm = true;
                }
            }
        }