Beispiel #1
0
        private void OnClear()
        {
            string       platformName = m_drawer.GetSelectedPlatformName();
            PlatformInfo platform     = PlatformEditorUtility.GetPlatform(platformName);

            if (DefinesEditorSettings.PlatformSettings.TryGetSettings(platform.BuildTargetGroup, out DefinesSettings settings))
            {
                DefinesBuildEditorUtility.ClearDefinesAll(platform.BuildTargetGroup, settings);
                AssetDatabase.SaveAssets();
            }
        }
Beispiel #2
0
        private void OnListDrawElement(ReorderableListDrawer drawer, string name, Rect rect, int index)
        {
            PlatformInfo platform = PlatformEditorUtility.GetPlatform(name);

            float height = EditorGUIUtility.singleLineHeight;
            float space  = EditorGUIUtility.standardVerticalSpacing;

            rect.y += space;

            SerializedProperty propertyElement = drawer.SerializedProperty.GetArrayElementAtIndex(index);
            SerializedProperty propertyValue   = propertyElement.FindPropertyRelative("m_value");

            var rectDefine = new Rect(rect.x, rect.y, rect.width - height + space, height);
            var rectFlag   = new Rect(rectDefine.xMax + space, rect.y, height, height);

            GUIContent flagContent = !string.IsNullOrEmpty(propertyValue.stringValue) && DefinesEditorUtility.HasDefine(propertyValue.stringValue, platform.BuildTargetGroup)
                ? m_styles.FlagOnContent
                : m_styles.FlagOffContent;

            EnabledPropertyGUIUtility.EnabledProperty(rectDefine, GUIContent.none, propertyElement, false);
            GUI.Label(rectFlag, flagContent, m_styles.FlagStyle);
        }