diff --git a/Assets/Editor/PolygonBuilderEditor.cs b/Assets/Editor/PolygonBuilderEditor.cs index a3b720aa..c7215229 100644 --- a/Assets/Editor/PolygonBuilderEditor.cs +++ b/Assets/Editor/PolygonBuilderEditor.cs @@ -11,9 +11,6 @@ public class PolygonBuilderEditor : EditorBase [SerializeField] private bool show; - [SerializeField] - private int selectedExtrusionType = -1; - public PolygonBuilderEditor() : base() { @@ -53,16 +50,8 @@ public PolygonBuilder.Options OnInspectorGUI(PolygonBuilder.Options options) return options; } - if (selectedExtrusionType == -1) - { - selectedExtrusionType = (int) options.Extrusion; - } - options.MaxHeight = EditorGUILayout.FloatField("Max Height: ", options.MaxHeight); - var extrusionTypeList = Enum.GetValues(typeof(PolygonBuilder.ExtrusionType)).Cast(); - var extrusionTypeStringList = extrusionTypeList.Select(type => type.ToString()); - selectedExtrusionType = EditorGUILayout.Popup("Extrusion type: ", selectedExtrusionType, extrusionTypeStringList.ToArray()); - options.Extrusion = (PolygonBuilder.ExtrusionType) selectedExtrusionType; + options.Extrusion = (PolygonBuilder.ExtrusionType)EditorGUILayout.EnumPopup("Extrusion type: ", options.Extrusion); options.Enabled = EditorGUILayout.Toggle("Enabled: ", options.Enabled); SavePreferences(); diff --git a/Assets/Editor/PolylineBuilderEditor.cs b/Assets/Editor/PolylineBuilderEditor.cs index b2a9278f..16340cb9 100644 --- a/Assets/Editor/PolylineBuilderEditor.cs +++ b/Assets/Editor/PolylineBuilderEditor.cs @@ -11,9 +11,6 @@ public class PolylineBuilderEditor : EditorBase [SerializeField] private bool show; - [SerializeField] - private int selectedExtrusionType = -1; - public PolylineBuilderEditor() : base() { @@ -55,17 +52,9 @@ public PolylineBuilder.Options OnInspectorGUI(PolylineBuilder.Options options) return options; } - if (selectedExtrusionType == -1) - { - selectedExtrusionType = (int) options.Extrusion; - } - options.Width = EditorGUILayout.FloatField("Width: ", options.Width); options.MaxHeight = EditorGUILayout.FloatField("Max Height: ", options.MaxHeight); - var extrusionTypeList = Enum.GetValues(typeof(PolygonBuilder.ExtrusionType)).Cast(); - var extrusionTypeStringList = extrusionTypeList.Select(type => type.ToString()); - selectedExtrusionType = EditorGUILayout.Popup("Extrusion type:", selectedExtrusionType, extrusionTypeStringList.ToArray()); - options.Extrusion = (PolygonBuilder.ExtrusionType) selectedExtrusionType; + options.Extrusion = (PolygonBuilder.ExtrusionType)EditorGUILayout.EnumPopup("Extrusion type: ", options.Extrusion); options.Enabled = EditorGUILayout.Toggle("Enabled: ", options.Enabled); SavePreferences();