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(); 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(); }
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(); } } }