Beispiel #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            base.BeginProperties();
            bool multiEditing = serializedObject.isEditingMultipleObjects;

            using (new EditorGUILayout.HorizontalScope()) {
                EditorGUILayout.PrefixLabel("Type");
                ShapesUI.DrawTypeSwitchButtons(propType, UIAssets.RectTypeButtonContents);
            }

            EditorGUILayout.PropertyField(propPivot);
            using (new EditorGUILayout.HorizontalScope()) {
                EditorGUILayout.PrefixLabel("Size");
                using (ShapesUI.TempLabelWidth(14)) {
                    EditorGUILayout.PropertyField(propWidth, new GUIContent("X"), GUILayout.MinWidth(20));
                    EditorGUILayout.PropertyField(propHeight, new GUIContent("Y"), GUILayout.MinWidth(20));
                }
            }

            bool isBorder = ((Rectangle)target).IsBorder;

            using (new EditorGUI.DisabledScope(!multiEditing && isBorder == false))
                ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace);

            bool hasRadius = ((Rectangle)target).IsRounded;

            using (new EditorGUI.DisabledScope(hasRadius == false)) {
                EditorGUILayout.PropertyField(propCornerRadiusMode, new GUIContent("Radius Mode"));
                CornerRadiusProperties();
            }

            rectEditor.GUIEditButton();

            bool hasDashablesInSelection = targets.Any(x => (x as Rectangle).IsBorder);

            using (new ShapesUI.GroupScope())
                using (new EditorGUI.DisabledScope(hasDashablesInSelection == false))
                    dashEditor.DrawProperties();

            fillEditor.DrawProperties(this);

            base.EndProperties();
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            base.BeginProperties();
            bool multiEditing = serializedObject.isEditingMultipleObjects;

            using (new EditorGUILayout.HorizontalScope()) {
                EditorGUILayout.PrefixLabel("Type");
                ShapesUI.DrawTypeSwitchButtons(propType, ShapesAssets.RectTypeButtonContents);
            }

            EditorGUILayout.PropertyField(propPivot);
            using (new EditorGUILayout.HorizontalScope()) {
                EditorGUILayout.PrefixLabel("Size");
                using (ShapesUI.TempLabelWidth(14)) {
                    EditorGUILayout.PropertyField(propWidth, new GUIContent("X"), GUILayout.MinWidth(20));
                    EditorGUILayout.PropertyField(propHeight, new GUIContent("Y"), GUILayout.MinWidth(20));
                }
            }

            bool isHollow = ((Rectangle)target).IsHollow;

            using (new EditorGUI.DisabledScope(!multiEditing && isHollow == false)) {
                EditorGUILayout.PropertyField(propThickness);
            }

            bool hasRadius = ((Rectangle)target).IsRounded;

            using (new EditorGUI.DisabledScope(hasRadius == false)) {
                EditorGUILayout.PropertyField(propCornerRadiusMode, new GUIContent("Radius Mode"));
                CornerRadiusProperties();
            }

            rectEditor.GUIEditButton();

            base.EndProperties();
        }