public override void OnInspectorGUI()
        {
            base.BeginProperties(showColor: true);

            EditorGUILayout.PropertyField(propGeometry);
            ShapesUI.DrawTypeSwitchButtons(propSides, SideCountTypes, indexToPolygonPreset);
            //ShapesUI.EnumButtonRow(); // todo
            EditorGUILayout.PropertyField(propSides);
            EditorGUILayout.PropertyField(propRoundness);

            ShapesUI.FloatInSpaceField(propRadius, propRadiusSpace);

            EditorGUILayout.PropertyField(propHollow);
            using (new EditorGUI.DisabledScope(propHollow.boolValue == false || propHollow.hasMultipleDifferentValues))
                ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace);
            ShapesUI.AngleProperty(propAngle, "Angle", propAngUnitInput, angLabelLayout);
            ShapesUI.DrawAngleSwitchButtons(propAngUnitInput);

            bool canEditInSceneView = propRadiusSpace.hasMultipleDifferentValues || propRadiusSpace.enumValueIndex == (int)ThicknessSpace.Meters;

            using (new EditorGUI.DisabledScope(canEditInSceneView == false))
                discEditor.GUIEditButton();

            fillEditor.DrawProperties(this);

            base.EndProperties();
        }
Exemple #2
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()
        {
            base.BeginProperties();
            EditorGUILayout.PropertyField(propTriangulation);

            bool changed = fillEditor.DrawProperties(this);

            if (hasManyPoints)                // to prevent lag when inspecting polylines with many points
            {
                string foldoutLabel = showPointList ? "Hide" : "Show Points";
                showPointList = GUILayout.Toggle(showPointList, foldoutLabel, EditorStyles.foldout);
            }

            if (showPointList)
            {
                pointList.DoLayoutList();
            }
            scenePointEditor.GUIEditButton("Edit Points in Scene");

            base.EndProperties();
        }