예제 #1
0
        protected override void RenderContent(UnityEngine.Object undoRecordObject)
        {
            float           newFloat; bool newBool; Color newColor;
            GizmoLine3DType newLineType;
            GizmoShadeMode  newShadeMode;
            GizmoFillMode3D newFillMode3D;
            GizmoCap3DType  newCap3DType;

            EditorGUILayoutEx.SectionHeader("Scale");
            var content = new GUIContent();

            content.text    = "Use zoom factor";
            content.tooltip = "If this is checked, the gizmo will maintain a constant size regardless of its distance from the camera.";
            newBool         = EditorGUILayout.ToggleLeft(content, UseZoomFactor);
            if (newBool != UseZoomFactor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetUseZoomFactor(newBool);
            }

            content.text    = "Scale";
            content.tooltip = "The gizmo 3D scale. This is useful when you need to make the gizmo bigger or smaller because it maintains the relationship between different size properties.";
            newFloat        = EditorGUILayout.FloatField(content, Scale);
            if (newFloat != Scale)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetScale(newFloat);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Slider shape");
            content.text    = "Slider type";
            content.tooltip = "The type of shape which is used to draw the single-axis sliders.";
            newLineType     = (GizmoLine3DType)EditorGUILayout.EnumPopup(content, SliderLineType);
            if (newLineType != SliderLineType)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderLineType(newLineType);
            }

            content.text    = "Slider length";
            content.tooltip = "The single-axis slider length.";
            newFloat        = EditorGUILayout.FloatField(content, SliderLength);
            if (newFloat != SliderLength)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderLength(newFloat);
            }

            if (SliderLineType == GizmoLine3DType.Box)
            {
                content.text    = "Box height";
                content.tooltip = "The box height for single-axis sliders when the slider type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, BoxSliderHeight);
                if (newFloat != BoxSliderHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetBoxSliderHeight(newFloat);
                }

                content.text    = "Box depth";
                content.tooltip = "The box depth for single-axis sliders when the slider type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, BoxSliderDepth);
                if (newFloat != BoxSliderDepth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetBoxSliderDepth(newFloat);
                }
            }
            else
            if (SliderLineType == GizmoLine3DType.Cylinder)
            {
                content.text    = "Cylinder radius";
                content.tooltip = "The cylinder radius for single-axis sliders when the slider type is set to \'Cylinder\'.";
                newFloat        = EditorGUILayout.FloatField(content, CylinderSliderRadius);
                if (newFloat != CylinderSliderRadius)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetCylinderSliderRadius(newFloat);
                }
            }

            content.text    = "Dbl slider size";
            content.tooltip = "The size of the double-axis sliders. Applies to both dimensions.";
            newFloat        = EditorGUILayout.FloatField(content, DblSliderSize);
            if (newFloat != DblSliderSize)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderSize(newFloat);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Cap shape");
            content.text    = "Slider cap type";
            content.tooltip = "The type of shape which is used to draw the single-axis slider caps.";
            newCap3DType    = (GizmoCap3DType)EditorGUILayout.EnumPopup(content, SliderCapType);
            if (newCap3DType != SliderCapType)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderCapType(newCap3DType);
            }

            if (SliderCapType == GizmoCap3DType.Box)
            {
                content.text    = "Box width";
                content.tooltip = "The box width for single-axis slider caps when the cap type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderBoxCapWidth);
                if (newFloat != SliderBoxCapWidth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderBoxCapWidth(newFloat);
                }

                content.text    = "Box height";
                content.tooltip = "The box height for single-axis slider caps when the cap type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderBoxCapHeight);
                if (newFloat != SliderBoxCapHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderBoxCapHeight(newFloat);
                }

                content.text    = "Box depth";
                content.tooltip = "The box depth for single-axis slider caps when the cap type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderBoxCapDepth);
                if (newFloat != SliderBoxCapDepth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderBoxCapDepth(newFloat);
                }
            }
            else
            if (SliderCapType == GizmoCap3DType.Cone)
            {
                content.text    = "Cone height";
                content.tooltip = "The cone height for single-axis slider caps when the cap type is set to \'Cone\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderConeCapHeight);
                if (newFloat != SliderConeCapHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderConeCapHeight(newFloat);
                }

                content.text    = "Cone radius";
                content.tooltip = "The cone radius for single-axis slider caps when the cap type is set to \'Cone\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderConeCapBaseRadius);
                if (newFloat != SliderConeCapBaseRadius)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderConeCapBaseRadius(newFloat);
                }
            }
            else
            if (SliderCapType == GizmoCap3DType.Pyramid)
            {
                content.text    = "Pyramid width";
                content.tooltip = "The pyramid width for single-axis slider caps when the cap type is set to \'Pyramid\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderPyramidCapWidth);
                if (newFloat != SliderPyramidCapWidth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderPyramidCapWidth(newFloat);
                }

                content.text    = "Pyramid height";
                content.tooltip = "The pyramid height for single-axis slider caps when the cap type is set to \'Pyramid\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderPyramidCapHeight);
                if (newFloat != SliderPyramidCapHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderPyramidCapHeight(newFloat);
                }

                content.text    = "Pyramid depth";
                content.tooltip = "The pyramid depth for single-axis slider caps when the cap type is set to \'Pyramid\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderPyramidCapDepth);
                if (newFloat != SliderPyramidCapDepth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderPyramidCapDepth(newFloat);
                }
            }
            else
            if (SliderCapType == GizmoCap3DType.TriangPrism)
            {
                content.text    = "Triang prism width";
                content.tooltip = "The prism width for single-axis slider caps when the cap type is set to \'TriangPrism\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderTriPrismCapWidth);
                if (newFloat != SliderTriPrismCapWidth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderTriPrismCapWidth(newFloat);
                }

                content.text    = "Triang prism height";
                content.tooltip = "The prism height for single-axis slider caps when the cap type is set to \'TriangPrism\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderTriPrismCapHeight);
                if (newFloat != SliderTriPrismCapHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderTriPrismCapHeight(newFloat);
                }

                content.text    = "Triang prism depth";
                content.tooltip = "The prism depth for single-axis slider caps when the cap type is set to \'TriangPrism\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderTriPrismCapDepth);
                if (newFloat != SliderTriPrismCapDepth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderTriPrismCapDepth(newFloat);
                }
            }
            else
            if (SliderCapType == GizmoCap3DType.Sphere)
            {
                content.text    = "Sphere radius";
                content.tooltip = "The sphere radius for single-axis slider caps when the cap type is set to \'Sphere\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderSphereCapRadius);
                if (newFloat != SliderSphereCapRadius)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderSphereCapRadius(newFloat);
                }
            }

            content.text    = "Mid cap type";
            content.tooltip = "The type of shape which is used to draw the mid cap.";
            newCap3DType    = (GizmoCap3DType)EditorGUILayoutEx.SelectiveEnumPopup(content, MidCapType, GetAllowedMidCapTypes());
            if (newCap3DType != MidCapType)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetMidCapType(newCap3DType);
            }

            if (MidCapType == GizmoCap3DType.Sphere)
            {
                content.text    = "Sphere radius";
                content.tooltip = "The mid cap sphere radius when the mid cap type is set to \'Sphere\'.";
                newFloat        = EditorGUILayout.FloatField(content, MidCapSphereRadius);
                if (newFloat != MidCapSphereRadius)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetMidCapSphereRadius(newFloat);
                }
            }
            else
            if (MidCapType == GizmoCap3DType.Box)
            {
                content.text    = "Box width";
                content.tooltip = "The mid cap box width when the mid cap type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, MidCapBoxWidth);
                if (newFloat != MidCapBoxWidth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetMidCapBoxWidth(newFloat);
                }

                content.text    = "Box height";
                content.tooltip = "The mid cap box height when the mid cap type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, MidCapBoxHeight);
                if (newFloat != MidCapBoxHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetMidCapBoxHeight(newFloat);
                }

                content.text    = "Box depth";
                content.tooltip = "The mid cap box depth when the mid cap type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, MidCapBoxDepth);
                if (newFloat != MidCapBoxDepth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetMidCapBoxDepth(newFloat);
                }
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Colors");
            string[] axesLabels = new string[] { "X", "Y", "Z" };
            for (int axisIndex = 0; axisIndex < 3; ++axisIndex)
            {
                GizmoLineSlider3DLookAndFeel sliderLookAndFeel = GetSglSliderLookAndFeel(axisIndex, AxisSign.Positive);

                content.text    = axesLabels[axisIndex];
                content.tooltip = "The color of the " + axesLabels[axisIndex] + " axis when it is not hovered.";
                newColor        = EditorGUILayout.ColorField(content, sliderLookAndFeel.Color);
                if (newColor != sliderLookAndFeel.Color)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetAxisColor(axisIndex, newColor);
                }
            }

            content.text    = "Mid cap";
            content.tooltip = "The color of the mid cap.";
            newColor        = EditorGUILayout.ColorField(content, MidCapColor);
            if (newColor != MidCapColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetMidCapColor(newColor);
            }

            content.text    = "Hovered";
            content.tooltip = "The gizmo hovered color.";
            newColor        = EditorGUILayout.ColorField(content, HoveredColor);
            if (newColor != HoveredColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetHoveredColor(newColor);
            }

            content.text    = "Dbl slider fill alpha";
            content.tooltip = "The alpha value used to draw the area of the double-axis sliders.";
            newFloat        = EditorGUILayout.FloatField(content, DblSliderFillAlpha);
            if (newFloat != DblSliderFillAlpha)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderFillAlpha(newFloat);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Shading");
            content.text    = "Sliders";
            content.tooltip = "The type of shading that is applied to single-axis sliders. Does not apply to caps. Caps have their own shade property.";
            newShadeMode    = (GizmoShadeMode)EditorGUILayout.EnumPopup(content, SliderShadeMode);
            if (newShadeMode != SliderShadeMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderShadeMode(newShadeMode);
            }

            content.text    = "Slider caps";
            content.tooltip = "The type of shading that is applied to single-axis slider caps.";
            newShadeMode    = (GizmoShadeMode)EditorGUILayout.EnumPopup(content, SliderCapShadeMode);
            if (newShadeMode != SliderCapShadeMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderCapShadeMode(newShadeMode);
            }

            content.text    = "Mid cap";
            content.tooltip = "The type of shading that is applied to the mid cap.";
            newShadeMode    = (GizmoShadeMode)EditorGUILayout.EnumPopup(content, MidCapShadeMode);
            if (newShadeMode != MidCapShadeMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetMidCapShadeMode(newShadeMode);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Fill");
            content.text    = "Sliders";
            content.tooltip = "Fill mode for single-axis sliders. Does not apply to caps. Caps have their own fill property.";
            newFillMode3D   = (GizmoFillMode3D)EditorGUILayout.EnumPopup(content, SliderFillMode);
            if (newFillMode3D != SliderFillMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderFillMode(newFillMode3D);
            }

            content.text    = "Slider caps";
            content.tooltip = "Fill mode for slider caps.";
            newFillMode3D   = (GizmoFillMode3D)EditorGUILayout.EnumPopup(content, SliderCapFillMode);
            if (newFillMode3D != SliderCapFillMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderCapFillMode(newFillMode3D);
            }

            content.text    = "Mid cap";
            content.tooltip = "Fill mode for the mid cap.";
            newFillMode3D   = (GizmoFillMode3D)EditorGUILayout.EnumPopup(content, MidCapFillMode);
            if (newFillMode3D != MidCapFillMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetMidCapFillMode(newFillMode3D);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Scale guide");
            content.text    = "Is visible";
            content.tooltip = "If this is checked, the gizmo will draw a scale guide for each entity that is being scaled during a scale session. The guide is shown " +
                              "in the form of a collection of coordinate system axes.";
            newBool = EditorGUILayout.ToggleLeft(content, IsScaleGuideVisible);
            if (newBool != IsScaleGuideVisible)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetScaleGuideVisible(newBool);
            }

            content.text    = "Axis length";
            content.tooltip = "If the scale guide is visible, this value is used to determine the length of the guide axes.";
            newFloat        = EditorGUILayout.FloatField(content, ScaleGuideAxisLength);
            if (newFloat != ScaleGuideAxisLength)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetScaleGuideAxisLength(newFloat);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Slider visibility");
            DrawSliderVisibilityControls(AxisSign.Positive, undoRecordObject);
            DrawSliderVisibilityControls(AxisSign.Negative, undoRecordObject);
            DrawCheckUncheckAllSlidersVisButtons(false, undoRecordObject);

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Dbl slider visibility");
            DrawDblSliderVisibilityControls(undoRecordObject);
            DrawCheckUncheckAllDblSlidersVisButtons(undoRecordObject);

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Cap visibility");
            DrawSliderCapVisibilityControls(AxisSign.Positive, undoRecordObject);
            DrawSliderCapVisibilityControls(AxisSign.Negative, undoRecordObject);
            DrawCheckUncheckAllSlidersVisButtons(true, undoRecordObject);
        }
        protected override void RenderContent(UnityEngine.Object undoRecordObject)
        {
            bool           newBool; Color newColor; Vector2 newVec2; float newFloat;
            GizmoShadeMode newShadeMode; SceneGizmoScreenCorner newScreenCorner;
            GizmoCap3DType newCapType;

            EditorGUILayoutEx.SectionHeader("Placement");
            var content = new GUIContent();

            content.text    = "Screen corner";
            content.tooltip = "Allows you to specify the screen corner in which the gizmo will be rendered.";
            newScreenCorner = (SceneGizmoScreenCorner)EditorGUILayout.EnumPopup(content, ScreenCorner);
            if (newScreenCorner != ScreenCorner)
            {
                EditorUndoEx.Record(undoRecordObject);
                ScreenCorner = newScreenCorner;
            }

            content.text    = "Screen offset";
            content.tooltip = "Allows you to apply an offset to the scene gizmo in screen space to change the location of where the gizmo is drawn on the screen.";
            newVec2         = EditorGUILayout.Vector2Field(content, ScreenOffset);
            if (newVec2 != ScreenOffset)
            {
                EditorUndoEx.Record(undoRecordObject);
                ScreenOffset = newVec2;
            }

            content.text    = "Screen size";
            content.tooltip = "Allows you to change the gizmo screen size.";
            newFloat        = EditorGUILayout.FloatField(content, ScreenSize);
            if (newFloat != ScreenSize)
            {
                EditorUndoEx.Record(undoRecordObject);
                ScreenSize = newFloat;
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Shapes");
            content.text    = "Axes caps";
            content.tooltip = "Allows you to change the shape of the axes caps.";
            newCapType      = (GizmoCap3DType)EditorGUILayoutEx.SelectiveEnumPopup(content, AxisCapLookAndFeel.CapType, GetAllowedAxesCapTypes());
            if (newCapType != AxisCapLookAndFeel.CapType)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetAxisCapType(newCapType);
            }

            content.text    = "Mid cap";
            content.tooltip = "Allows you to change the shape of the middle cap.";
            newCapType      = (GizmoCap3DType)EditorGUILayoutEx.SelectiveEnumPopup(content, _midCapLookAndFeel.CapType, GetAllowedMidCapTypes());
            if (newCapType != _midCapLookAndFeel.CapType)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetMidCapType(newCapType);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Shading");
            content.text    = "Axes caps";
            content.tooltip = "The type of shading that is applied to the axes caps.";
            newShadeMode    = (GizmoShadeMode)EditorGUILayout.EnumPopup(content, AxisCapLookAndFeel.ShadeMode);
            if (newShadeMode != AxisCapLookAndFeel.ShadeMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetAxisCapShadeMode(newShadeMode);
            }

            content.text    = "Mid cap";
            content.tooltip = "The type of shading that is applied to the middle cap.";
            newShadeMode    = (GizmoShadeMode)EditorGUILayout.EnumPopup(content, _midCapLookAndFeel.ShadeMode);
            if (newShadeMode != _midCapLookAndFeel.ShadeMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetMidCapShadeMode(newShadeMode);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Colors");
            string[]   axesCapLabels = new string[] { "Positive X", "Positive Y", "Positive Z", "Negative X", "Negative Y", "Negative Z" };
            int[]      axesIndices   = new int[] { 0, 1, 2, 0, 1, 2 };
            AxisSign[] axesSigns     = new AxisSign[] { AxisSign.Positive, AxisSign.Positive, AxisSign.Positive, AxisSign.Negative, AxisSign.Negative, AxisSign.Negative };
            for (int axisIndex = 0; axisIndex < 6; ++axisIndex)
            {
                content.text    = axesCapLabels[axisIndex];
                content.tooltip = "The color of the " + axesCapLabels[axisIndex].ToLower() + ".";

                var lookAndFeel = GetAxisCapLookAndFeel(axesIndices[axisIndex], axesSigns[axisIndex]);
                newColor = EditorGUILayout.ColorField(content, lookAndFeel.Color);
                if (newColor != lookAndFeel.Color)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetAxisCapColor(newColor, axesIndices[axisIndex], axesSigns[axisIndex]);
                }
            }

            content.text    = "Mid cap";
            content.tooltip = "Allows you to change the color of the mid cap.";
            newColor        = EditorGUILayout.ColorField(content, _midCapLookAndFeel.Color);
            if (newColor != _midCapLookAndFeel.Color)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetMidCapColor(newColor);
            }

            content.text    = "Hovered color";
            content.tooltip = "Gizmo hovered color.";
            newColor        = EditorGUILayout.ColorField(content, AxisCapLookAndFeel.HoveredColor);
            if (newColor != AxisCapLookAndFeel.HoveredColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetHoveredColor(newColor);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Labels");
            EditorGUILayout.HelpBox("The alpha value of the axes labels is ignored. The alpha component will always have the same value as the corresponding axis.", MessageType.Info);
            content.text    = "Axes label tint";
            content.tooltip = "Allows you to change the color of the labels associated with the gizmo axes. Note: The alpha component is ignored. The alpha value will " +
                              "always be retrieved from the color of the associated axis.";
            newColor = EditorGUILayout.ColorField(content, AxesLabelTint);
            if (newColor != AxesLabelTint)
            {
                EditorUndoEx.Record(undoRecordObject);
                AxesLabelTint = newColor;
            }

            content.text    = "Cam prj switch label tint";
            content.tooltip = "Allows you to change the color of the label that is used to display the current camera projection type (perspective or ortho).";
            newColor        = EditorGUILayout.ColorField(content, CamPrjSwitchLabelTint);
            if (newColor != CamPrjSwitchLabelTint)
            {
                EditorUndoEx.Record(undoRecordObject);
                CamPrjSwitchLabelTint = newColor;
            }

            content.text    = "Show prj switch label";
            content.tooltip = "If this is checked, the gizmo will render a label which indicates the current camera projection type (perspective or ortho). " +
                              "This label can also be used to switch between the 2 camera projection modes.";
            newBool = EditorGUILayout.ToggleLeft(content, IsCamPrjSwitchLabelVisible);
            if (newBool != IsCamPrjSwitchLabelVisible)
            {
                EditorUndoEx.Record(undoRecordObject);
                IsCamPrjSwitchLabelVisible = newBool;
            }
        }
        protected override void RenderContent(UnityEngine.Object undoRecordObject)
        {
            float            newFloat; Color newColor; bool newBool;
            GizmoLine2DType  newLine2DType;
            GizmoCap2DType   newCap2DType;
            GizmoFillMode2D  newFillMode2D;
            GizmoPlane2DType newPlane2DType;

            EditorGUILayoutEx.SectionHeader("Scale");
            var content = new GUIContent();

            content.text    = "Scale";
            content.tooltip = "The gizmo 2D scale. This is useful when you need to make the gizmo bigger or smaller because it maintains the relationship between different size properties.";
            newFloat        = EditorGUILayout.FloatField(content, Scale);
            if (newFloat != Scale)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetScale(newFloat);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Slider shape");
            content.text    = "Slider type";
            content.tooltip = "The type of shape which is used to draw the single-axis sliders.";
            newLine2DType   = (GizmoLine2DType)EditorGUILayout.EnumPopup(content, SliderLineType);
            if (newLine2DType != SliderLineType)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderLineType(newLine2DType);
            }

            content.text    = "Slider length";
            content.tooltip = "The single-axis slider length.";
            newFloat        = EditorGUILayout.FloatField(content, SliderLength);
            if (newFloat != SliderLength)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderLength(newFloat);
            }

            if (SliderLineType == GizmoLine2DType.Box)
            {
                content.text    = "Slider box thickness";
                content.tooltip = "The box thickness for single-axis sliders when the slider type is set to \'Box\'.";
                newFloat        = EditorGUILayout.FloatField(content, BoxSliderThickness);
                if (newFloat != BoxSliderThickness)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetBoxSliderThickness(newFloat);
                }
            }

            content.text    = "Dbl slider type";
            content.tooltip = "The type of shape which is used to draw the double-axis slider.";
            newPlane2DType  = (GizmoPlane2DType)EditorGUILayoutEx.SelectiveEnumPopup(content, DblSliderPlaneType, GetAllowedDblSliderPlaneTypes());
            if (newPlane2DType != DblSliderPlaneType)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderPlaneType(newPlane2DType);
            }

            if (DblSliderPlaneType == GizmoPlane2DType.Quad)
            {
                content.text    = "Quad width";
                content.tooltip = "The double-axis slider quad width when the dbl slider type is set to \'Quad\'.";
                newFloat        = EditorGUILayout.FloatField(content, DblSliderQuadWidth);
                if (newFloat != DblSliderQuadWidth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetDblSliderQuadWidth(newFloat);
                }

                content.text    = "Quad height";
                content.tooltip = "The double-axis slider quad height when the dbl slider type is set to \'Quad\'.";
                newFloat        = EditorGUILayout.FloatField(content, DblSliderQuadHeight);
                if (newFloat != DblSliderQuadHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetDblSliderQuadHeight(newFloat);
                }
            }
            else
            if (DblSliderPlaneType == GizmoPlane2DType.Circle)
            {
                content.text    = "Circle radius";
                content.tooltip = "The double-axis slider circle radius when the dbl slider type is set to \'Circle\'.";
                newFloat        = EditorGUILayout.FloatField(content, DblSliderCircleRadius);
                if (newFloat != DblSliderCircleRadius)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetDblSliderCircleRadius(newFloat);
                }
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Cap shape");
            content.text    = "Slider cap type";
            content.tooltip = "The type of shape which is used to draw the single-axis slidre caps.";
            newCap2DType    = (GizmoCap2DType)EditorGUILayout.EnumPopup(content, SliderCapType);
            if (newCap2DType != SliderCapType)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderCapType(newCap2DType);
            }

            if (SliderCapType == GizmoCap2DType.Arrow)
            {
                content.text    = "Arrow height";
                content.tooltip = "The arrow height for slider caps when the cap type is set to \'Arrow\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderArrowCapHeight);
                if (newFloat != SliderArrowCapHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderArrowCapHeight(newFloat);
                }

                content.text    = "Arrow radius";
                content.tooltip = "The arrow radius for slider caps when the cap type is set to \'Arrow\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderArrowCapBaseRadius);
                if (newFloat != SliderArrowCapBaseRadius)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderArrowCapBaseRadius(newFloat);
                }
            }
            else
            if (SliderCapType == GizmoCap2DType.Quad)
            {
                content.text    = "Quad width";
                content.tooltip = "The quad width for slider caps when the cap type is set to \'Quad\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderQuadCapWidth);
                if (newFloat != SliderQuadCapWidth)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderQuadCapWidth(newFloat);
                }

                content.text    = "Quad height";
                content.tooltip = "The quad height for slider caps when the cap type is set to \'Quad\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderQuadCapHeight);
                if (newFloat != SliderQuadCapHeight)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderQuadCapHeight(newFloat);
                }
            }
            else
            if (SliderCapType == GizmoCap2DType.Circle)
            {
                content.text    = "Circle radius";
                content.tooltip = "The circle radius for slider caps when the cap type is set to \'Circle\'.";
                newFloat        = EditorGUILayout.FloatField(content, SliderCircleCapRadius);
                if (newFloat != SliderCircleCapRadius)
                {
                    EditorUndoEx.Record(undoRecordObject);
                    SetSliderCircleCapRadius(newFloat);
                }
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Colors");
            content.text    = "X fill";
            content.tooltip = "The X axis fill color. Applies to the X axis slider and its cap.";
            newColor        = EditorGUILayout.ColorField(content, XColor);
            if (newColor != XColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetAxisColor(0, newColor);
            }

            content.text    = "X border";
            content.tooltip = "The X axis border color. Applies to the X axis slider and its cap.";
            newColor        = EditorGUILayout.ColorField(content, XBorderColor);
            if (newColor != XBorderColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetAxisBorderColor(0, newColor);
            }

            content.text    = "Y fill";
            content.tooltip = "The Y axis fill color. Applies to the Y axis slider and its cap.";
            newColor        = EditorGUILayout.ColorField(content, YColor);
            if (newColor != YColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetAxisColor(1, newColor);
            }

            content.text    = "Y border";
            content.tooltip = "The Y axis border color. Applies to the Y axis slider and its cap.";
            newColor        = EditorGUILayout.ColorField(content, YBorderColor);
            if (newColor != YBorderColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetAxisBorderColor(1, newColor);
            }

            content.text    = "Hovered fill";
            content.tooltip = "The hovered fill color. Applies to single sliders and their caps only. The double slider has its own color properties.";
            newColor        = EditorGUILayout.ColorField(content, SliderHoveredColor);
            if (newColor != SliderHoveredColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderHoveredFillColor(newColor);
            }

            content.text    = "Hovered border";
            content.tooltip = "The hovered border color. Applies to single sliders and their caps only. The double slider has its own color properties.";
            newColor        = EditorGUILayout.ColorField(content, SliderHoveredBorderColor);
            if (newColor != SliderHoveredBorderColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderHoveredBorderColor(newColor);
            }

            EditorGUILayout.Separator();
            content.text    = "Dbl slider fill";
            content.tooltip = "The double-axis slider fill color.";
            newColor        = EditorGUILayout.ColorField(content, DblSliderColor);
            if (newColor != DblSliderColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderColor(newColor);
            }

            content.text    = "Dbl slider border";
            content.tooltip = "The double-axis slider border color.";
            newColor        = EditorGUILayout.ColorField(content, DblSliderBorderColor);
            if (newColor != DblSliderBorderColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderBorderColor(newColor);
            }

            content.text    = "Hovered dbl slider fill";
            content.tooltip = "The fill color of the double-axis slider when it is hovered.";
            newColor        = EditorGUILayout.ColorField(content, DblSliderHoveredColor);
            if (newColor != DblSliderHoveredColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderHoveredColor(newColor);
            }

            content.text    = "Hovered dbl slider border";
            content.tooltip = "The border color of the double-axis slider when it is hovered.";
            newColor        = EditorGUILayout.ColorField(content, DblSliderHoveredBorderColor);
            if (newColor != DblSliderHoveredBorderColor)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderHoveredBorderColor(newColor);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Fill");
            content.text    = "Sliders";
            content.tooltip = "The fill mode for single-axis sliders. Does not affet caps. Caps have their own fill property.";
            newFillMode2D   = (GizmoFillMode2D)EditorGUILayout.EnumPopup(content, SliderFillMode);
            if (newFillMode2D != SliderFillMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderFillMode(newFillMode2D);
            }

            content.text    = "Caps";
            content.tooltip = "The fill mode for single-axis slider caps.";
            newFillMode2D   = (GizmoFillMode2D)EditorGUILayout.EnumPopup(content, SliderCapFillMode);
            if (newFillMode2D != SliderCapFillMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetSliderCapFillMode(newFillMode2D);
            }

            content.text    = "Dbl slider";
            content.tooltip = "The double-slider fill mode.";
            newFillMode2D   = (GizmoFillMode2D)EditorGUILayout.EnumPopup(content, DblSliderFillMode);
            if (newFillMode2D != DblSliderFillMode)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderFillMode(newFillMode2D);
            }

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Slider visibility");
            DrawSliderVisibilityControls(AxisSign.Positive, undoRecordObject);
            DrawSliderVisibilityControls(AxisSign.Negative, undoRecordObject);
            DrawCheckUncheckAllSlidersVisButtons(false, undoRecordObject);

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Slider cap visibility");
            DrawSliderCapVisibilityControls(AxisSign.Positive, undoRecordObject);
            DrawSliderCapVisibilityControls(AxisSign.Negative, undoRecordObject);
            DrawCheckUncheckAllSlidersVisButtons(true, undoRecordObject);

            EditorGUILayout.Separator();
            EditorGUILayoutEx.SectionHeader("Dbl slider visibility");
            content.text    = "Is visible";
            content.tooltip = "Controls the visiblity of the double slider.";
            newBool         = EditorGUILayout.ToggleLeft(content, IsDblSliderVisible);
            if (newBool != IsDblSliderVisible)
            {
                EditorUndoEx.Record(undoRecordObject);
                SetDblSliderVisible(newBool);
            }
        }