Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 void DrawAngleProperties(DiscType selectedType)
 {
     using (new EditorGUI.DisabledScope(selectedType.HasSector() == false && serializedObject.isEditingMultipleObjects == false)) {
         ShapesUI.AngleProperty(propAngRadiansStart, "Angle start", propAngUnitInput, angLabelLayout);
         ShapesUI.AngleProperty(propAngRadiansEnd, "Angle end", propAngUnitInput, angLabelLayout);
         ShapesUI.DrawAngleSwitchButtons(propAngUnitInput);
     }
 }
Exemplo n.º 3
0
 void DrawAngleProperties(DiscType selectedType)
 {
     using (new EditorGUI.DisabledScope(selectedType.HasSector() == false && serializedObject.isEditingMultipleObjects == false)) {
         ShapesUI.AngleProperty(propAngRadiansStart, "Angle start", propAngUnitInput, angLabelLayout);
         ShapesUI.AngleProperty(propAngRadiansEnd, "Angle end", propAngUnitInput, angLabelLayout);
         GUILayout.BeginHorizontal();
         EditorGUILayout.PrefixLabel(" ");
         GUIContent[] angLabels = (Screen.width < 300) ? ShapesAssets.AngleUnitButtonContentsShort : ShapesAssets.AngleUnitButtonContents;
         ShapesUI.DrawTypeSwitchButtons(propAngUnitInput, angLabels, 15);
         GUILayout.EndHorizontal();
     }
 }