// Draw the window
        void OnGUI()
        {
            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label("Defaults", EditorStyles.boldLabel);
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            // Draw two buttons for the default testing and shipping configurations
            if (GUILayout.Button(new GUIContent("Apply Default Testing")))
            {
                BuildSetup.DefaultTestingSetup();
            }

            if (GUILayout.Button(new GUIContent("Apply Default Shipping")))
            {
                BuildSetup.DefaultShippingSetup();
            }

            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label("Select Configuration", EditorStyles.boldLabel);
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            // If no BuildConfiguration assets are found, no llist popup will appear
            if (_guids.Length == 0)
            {
                EditorGUILayout.LabelField("Create a build configuration asset first");
            }
            else
            {
                _idx = EditorGUILayout.Popup(_idx, _names);
                EditorGUILayout.Space();

                if (GUILayout.Button(new GUIContent("Apply Selected Configuration")))
                {
                    BuildSetup.Setup(_configurations[_idx]);
                }
            }
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();

            // Click this button to apply the configuration
            if (GUILayout.Button("Apply this configuration"))
            {
                BuildConfiguration config = target as BuildConfiguration;
                if (config != null)
                {
                    BuildSetup.Setup(config);
                }
            }
        }