예제 #1
0
        void DrawDocumentationButtons()
        {
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_DOCUMENTATION_BUTTON,
                                 BTEditorUtility.DefineLayoutSizingConstraints(10, 20, 60, 600)))
            {
                OnDocumentationButtonPressed(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_DOCUMENTATION_URL);
            }

            if (GUILayout.Button(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_VIDEO_BUTTON,
                                 BTEditorUtility.DefineLayoutSizingConstraints(10, 20, 60, 600)))
            {
                OnDocumentationButtonPressed(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_VIDEO_URL);
            }

            if (GUILayout.Button(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_SUPPORT_BUTTON,
                                 BTEditorUtility.DefineLayoutSizingConstraints(10, 20, 60, 600)))
            {
                OnDocumentationButtonPressed(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_SUPPORT_URL);
            }

            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }
예제 #2
0
        void DrawConfigCreatorSection()
        {
            BTEditorUtility.DrawSubHeading(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_CONFIGCREATIONSECTION_SUBHEADER);

            // Buttons
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_CONFIGCREATION_BUTTON,
                                 BTEditorUtility.DefineLayoutSizingConstraints(10, 30, 60, position.width / 2)))
            {
                string fullPath = pathToCreateScriptable + configFileName + ".asset";
                if (File.Exists(fullPath))
                {
                    windowLogMessage = fullPath + " already exists! No configuration asset was created.";
                    logMessageType   = MessageType.Warning;
                    return;
                }

                if (!Directory.Exists(pathToCreateScriptable))
                {
                    Directory.CreateDirectory(pathToCreateScriptable);
                    windowLogMessage = pathToCreateScriptable + " directory created.\n" + fullPath + " created successfully!";
                }
                else
                {
                    windowLogMessage = fullPath + " created successfully!";
                }
                logMessageType = MessageType.Info;

                BacktraceConfiguration configAsset = ScriptableObject.CreateInstance <BacktraceConfiguration>();
                AssetDatabase.CreateAsset(configAsset, fullPath);
                AssetDatabase.SaveAssets();

                EditorUtility.FocusProjectWindow();
                Selection.activeObject       = configAsset;
                backtraceConfiguration       = configAsset;
                backtraceConfigurationEditor = UnityEditor.Editor.CreateEditor(backtraceConfiguration);
            }

            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();


            // Text fields
            GUILayout.BeginHorizontal();

            GUILayout.BeginVertical();
            EditorStyles.textField.wordWrap = true;
            GUILayout.Label(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_CONFIGNAME);
            configFileName = GUILayout.TextField(configFileName,
                                                 BTEditorUtility.DefineLayoutSizingConstraints(10, 20, 60, 600));
            GUILayout.EndVertical();

            GUILayout.BeginVertical();
            GUILayout.Label(BacktraceIntegrationWindowLabels.LABEL_INTEGRATION_ASSETPATH);

            pathToCreateScriptable = GUILayout.TextField(pathToCreateScriptable,
                                                         BTEditorUtility.DefineLayoutSizingConstraints(10, 20, 60, 600));
            EditorStyles.textField.wordWrap = false;
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }