public override void OnInspectorGUI() { serializedObject.Update(); base.BeginProperties(); ShapesUI.FloatInSpaceField(propSize, propSizeSpace); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { base.BeginProperties(); ShapesUI.FloatInSpaceField(propRadius, propRadiusSpace); ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace); base.EndProperties(); }
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(); }
public override void OnInspectorGUI() { base.BeginProperties(); if (Event.current.type == EventType.Layout) { showZ = targets.Any(x => ((Polyline)x).Geometry != PolylineGeometry.Flat2D); } EditorGUILayout.PropertyField(propGeometry); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(propJoins); ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace); 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(); }
public override void OnInspectorGUI() { base.BeginProperties(); EditorGUILayout.PropertyField(propGeometry); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(propJoins); ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace); 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"); if (base.EndProperties()) { UpdateMesh(); } }
public override void OnInspectorGUI() { base.BeginProperties(showColor: false); // Color properties EditorGUILayout.PropertyField(propColorMode); switch ((Disc.DiscColorMode)propColorMode.enumValueIndex) { case Disc.DiscColorMode.Single: base.PropertyFieldColor(); break; case Disc.DiscColorMode.Radial: base.PropertyFieldColor("Inner"); EditorGUILayout.PropertyField(propColorOuterStart, new GUIContent("Outer")); break; case Disc.DiscColorMode.Angular: base.PropertyFieldColor("Start"); EditorGUILayout.PropertyField(propColorInnerEnd, new GUIContent("End")); break; case Disc.DiscColorMode.Bilinear: base.PropertyFieldColor("Inner Start"); EditorGUILayout.PropertyField(propColorOuterStart, new GUIContent("Outer Start")); EditorGUILayout.PropertyField(propColorInnerEnd, new GUIContent("Inner End")); EditorGUILayout.PropertyField(propColorOuterEnd, new GUIContent("Outer End")); break; } using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.PrefixLabel("Type"); ShapesUI.DrawTypeSwitchButtons(propType, ShapesAssets.DiscTypeButtonContents, 20); } DiscType selectedType = (DiscType)propType.enumValueIndex; if (propType.enumValueIndex == (int)DiscType.Arc) { ShapesUI.EnumToggleProperty(propArcEndCaps, "Round Caps"); } ShapesUI.FloatInSpaceField(propRadius, propRadiusSpace); using (new EditorGUI.DisabledScope(selectedType.HasThickness() == false && serializedObject.isEditingMultipleObjects == false)) ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace); DrawAngleProperties(selectedType); ShapesUI.BeginGroup(); dashEditor.DrawProperties(); ShapesUI.EndGroup(); base.EndProperties(); }
public override void OnInspectorGUI() { base.BeginProperties(); ShapesUI.FloatInSpaceField(propRadius, propSizeSpace); ShapesUI.FloatInSpaceField(propLength, propSizeSpace, spaceEnabled: false); EditorGUILayout.PropertyField(propFillCap); if (base.EndProperties()) { foreach (Cone cone in targets.Cast <Cone>()) { cone.UpdateMesh(); } } }
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(showColor: false); EditorGUILayout.PropertyField(propGeometry); // Color properties EditorGUILayout.PropertyField(propColorMode); switch ((Disc.DiscColorMode)propColorMode.enumValueIndex) { case Disc.DiscColorMode.Single: base.PropertyFieldColor(); break; case Disc.DiscColorMode.Radial: base.PropertyFieldColor("Inner"); EditorGUILayout.PropertyField(propColorOuterStart, new GUIContent("Outer")); break; case Disc.DiscColorMode.Angular: base.PropertyFieldColor("Start"); EditorGUILayout.PropertyField(propColorInnerEnd, new GUIContent("End")); break; case Disc.DiscColorMode.Bilinear: base.PropertyFieldColor("Inner Start"); EditorGUILayout.PropertyField(propColorOuterStart, new GUIContent("Outer Start")); EditorGUILayout.PropertyField(propColorInnerEnd, new GUIContent("Inner End")); EditorGUILayout.PropertyField(propColorOuterEnd, new GUIContent("Outer End")); break; } using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.PrefixLabel("Type"); ShapesUI.DrawTypeSwitchButtons(propType, UIAssets.DiscTypeButtonContents); } DiscType selectedType = (DiscType)propType.enumValueIndex; if (propType.enumValueIndex == (int)DiscType.Arc) { ShapesUI.EnumToggleProperty(propArcEndCaps, "Round Caps"); } ShapesUI.FloatInSpaceField(propRadius, propRadiusSpace); using (new EditorGUI.DisabledScope(selectedType.HasThickness() == false && serializedObject.isEditingMultipleObjects == false)) ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace); DrawAngleProperties(selectedType); bool canEditInSceneView = propRadiusSpace.hasMultipleDifferentValues || propRadiusSpace.enumValueIndex == (int)ThicknessSpace.Meters; using (new EditorGUI.DisabledScope(canEditInSceneView == false)) discEditor.GUIEditButton(); bool hasDashablesInSelection = targets.Any(x => (x as Disc).HasThickness); using (new ShapesUI.GroupScope()) using (new EditorGUI.DisabledScope(hasDashablesInSelection == false)) dashEditor.DrawProperties(); base.EndProperties(); }
public override void OnInspectorGUI() { SerializedObject so = serializedObject; // show detail edit bool showDetailEdit = targets.OfType <Line>().Any(x => x.Geometry == LineGeometry.Volumetric3D); base.BeginProperties(showColor: false, canEditDetailLevel: showDetailEdit); bool updateGeometry = false; EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(propGeometry, new GUIContent("Geometry")); if (EditorGUI.EndChangeCheck()) { updateGeometry = true; } EditorGUILayout.PropertyField(propStart); EditorGUILayout.PropertyField(propEnd); ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace); scenePointEditor.GUIEditButton("Edit Points in Scene"); // style (color, caps, dashes) ShapesUI.BeginGroup(); EditorGUILayout.PropertyField(propColorMode); if ((Line.LineColorMode)propColorMode.enumValueIndex == Line.LineColorMode.Single) { base.PropertyFieldColor(); } else { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.PrefixLabel("Colors"); base.PropertyFieldColor(GUIContent.none); EditorGUILayout.PropertyField(propColorEnd, GUIContent.none); } } using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.PrefixLabel("End Caps"); if (ShapesUI.DrawTypeSwitchButtons(propEndCaps, UIAssets.LineCapButtonContents)) { updateGeometry = true; } } ShapesUI.EndGroup(); // Dashes ShapesUI.BeginGroup(); dashEditor.DrawProperties(); ShapesUI.EndGroup(); base.EndProperties(); if (updateGeometry) { foreach (Line line in targets.Cast <Line>()) { line.UpdateMesh(); } } }
public override void OnInspectorGUI() { SerializedObject so = serializedObject; base.BeginProperties(showColor: false); bool updateGeometry = false; EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(propGeometry, new GUIContent("Geometry")); if (EditorGUI.EndChangeCheck()) { updateGeometry = true; } // shape (positions & thickness) ShapesUI.BeginGroup(); EditorGUILayout.PropertyField(propStart); EditorGUILayout.PropertyField(propEnd); ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace); ShapesUI.EndGroup(); // style (color, caps, dashes) ShapesUI.BeginGroup(); EditorGUILayout.PropertyField(propColorMode); if ((Line.LineColorMode)propColorMode.enumValueIndex == Line.LineColorMode.Single) { base.PropertyFieldColor(); } else { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.PrefixLabel("Colors"); base.PropertyFieldColor(GUIContent.none); EditorGUILayout.PropertyField(propColorEnd, GUIContent.none); } } using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.PrefixLabel("End Caps"); if (ShapesUI.DrawTypeSwitchButtons(propEndCaps, ShapesAssets.LineCapButtonContents, 20)) { updateGeometry = true; } } ShapesUI.EndGroup(); // Dashes ShapesUI.BeginGroup(); dashEditor.DrawProperties(); ShapesUI.EndGroup(); base.EndProperties(); if (updateGeometry) { foreach (Line line in targets.Cast <Line>()) { line.UpdateMesh(); } } }
public override void OnInspectorGUI() { base.BeginProperties(); ShapesUI.FloatInSpaceField(propSize, propSizeSpace); base.EndProperties(); }