Skip to content

Commit dc22e22

Browse files
committed
Fix indentation.
1 parent 6b14853 commit dc22e22

File tree

6 files changed

+34
-20
lines changed

6 files changed

+34
-20
lines changed

sdkproject/Assets/Mapbox/Unity/DataContainers/MapboxEnums.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,20 @@ public enum ElevationLayerType
139139
}
140140
public enum ExtrusionType
141141
{
142+
[Description("No extrusion.")]
142143
None,
144+
[Description("Extrude features using the property value.")]
143145
PropertyHeight,
146+
[Description("Extrude features using the property value. Extrusion from features minimum height value. Results in flat tops.")]
144147
MinHeight,
148+
[Description("Extrude features using the property value. Extrusion from features maximum height value. Results in flat tops.")]
145149
MaxHeight,
150+
[Description("Extrude features using the property value. Values are clamped in to min and max values if they are lower or greater than min,max values respectively.")]
146151
RangeHeight,
152+
[Description("Extrude all features using the fixed value.")]
147153
AbsoluteHeight,
154+
155+
148156
}
149157

150158
public enum ExtrusionGeometryType

sdkproject/Assets/Mapbox/Unity/Editor/PropertyDrawers/CoreVectorLayerPropertiesDrawer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
1818
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("isActive"));
1919
position.y += lineHeight;
2020
var primitiveType = property.FindPropertyRelative("geometryType");
21-
var typePosition = EditorGUI.PrefixLabel(new Rect(position.x, position.y, position.width, lineHeight), GUIUtility.GetControlID(FocusType.Passive), new GUIContent { text = "Primitive Type", tooltip = "Primitive geometry type of the visualizer, allowed primitives - point, line, polygon." });
2221

22+
var typePosition = EditorGUI.PrefixLabel(new Rect(position.x, position.y, position.width, lineHeight), GUIUtility.GetControlID(FocusType.Passive), new GUIContent { text = "Primitive Type", tooltip = "Primitive geometry type of the visualizer, allowed primitives - point, line, polygon." });
23+
EditorGUI.indentLevel--;
2324
primitiveType.enumValueIndex = EditorGUI.Popup(typePosition, primitiveType.enumValueIndex, primitiveType.enumDisplayNames);
25+
EditorGUI.indentLevel++;
2426

2527
position.y += lineHeight;
2628
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("layerName"));

sdkproject/Assets/Mapbox/Unity/Editor/PropertyDrawers/GeometryExtrusionOptionsDrawer.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
1616
var typePosition = EditorGUI.PrefixLabel(new Rect(position.x, position.y, position.width, lineHeight), GUIUtility.GetControlID(FocusType.Passive), new GUIContent("Extrusion Type"));
1717
var extrusionTypeProperty = property.FindPropertyRelative("extrusionType");
1818

19+
EditorGUI.indentLevel--;
1920
extrusionTypeProperty.enumValueIndex = EditorGUI.Popup(typePosition, extrusionTypeProperty.enumValueIndex, extrusionTypeProperty.enumDisplayNames);
21+
EditorGUI.indentLevel++;
2022
var sourceTypeValue = (Unity.Map.ExtrusionType)extrusionTypeProperty.enumValueIndex;
2123

2224
var minHeightProperty = property.FindPropertyRelative("minimumHeight");
@@ -38,18 +40,12 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
3840
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("extrusionGeometryType"));
3941
position.y += lineHeight;
4042
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("propertyName"));
41-
position.y += lineHeight;
42-
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), minHeightProperty);
43-
//maxHeightProperty.floatValue = minHeightProperty.floatValue;
4443
break;
4544
case Unity.Map.ExtrusionType.MaxHeight:
4645
position.y += lineHeight;
4746
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("extrusionGeometryType"));
4847
position.y += lineHeight;
4948
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), property.FindPropertyRelative("propertyName"));
50-
position.y += lineHeight;
51-
EditorGUI.PropertyField(new Rect(position.x, position.y, position.width, lineHeight), maxHeightProperty);
52-
//min.floatValue = minHeightProperty.floatValue;
5349
break;
5450
case Unity.Map.ExtrusionType.RangeHeight:
5551
position.y += lineHeight;
@@ -88,11 +84,9 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent
8884
rows += 1;
8985
break;
9086
case Unity.Map.ExtrusionType.PropertyHeight:
91-
rows += 3;
92-
break;
9387
case Unity.Map.ExtrusionType.MinHeight:
9488
case Unity.Map.ExtrusionType.MaxHeight:
95-
rows += 4;
89+
rows += 3;
9690
break;
9791
case Unity.Map.ExtrusionType.RangeHeight:
9892
rows += 5;

sdkproject/Assets/Mapbox/Unity/Editor/PropertyDrawers/GeometryMaterialOptionsDrawer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
2222
var typePosition = EditorGUI.PrefixLabel(new Rect(position.x, position.y, position.width, lineHeight), GUIUtility.GetControlID(FocusType.Passive), new GUIContent { text = "Texturing Type", tooltip = "Use image texture from the Imagery source as texture for roofs. " });
2323
var texturingType = property.FindPropertyRelative("texturingType");
2424
EditorGUI.indentLevel--;
25+
EditorGUI.indentLevel--;
2526
texturingType.enumValueIndex = EditorGUI.Popup(typePosition, texturingType.enumValueIndex, texturingType.enumDisplayNames);
2627
EditorGUI.indentLevel++;
28+
EditorGUI.indentLevel++;
2729

2830
var matList = property.FindPropertyRelative("materials");
2931
if (matList.arraySize == 0)

sdkproject/Assets/Mapbox/Unity/Editor/PropertyDrawers/VectorFilterOptionsDrawer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
3535
{
3636
EditorGUILayout.PropertyField(property.FindPropertyRelative("combinerType"));
3737
}
38-
38+
EditorGUI.indentLevel++;
3939
EditorGUILayout.BeginHorizontal();
40+
GUILayout.Space(EditorGUI.indentLevel * 12);
4041
if (GUILayout.Button(new GUIContent("Add New Empty"), (GUIStyle)"minibutton"))
4142
{
4243
propertyFilters.arraySize++;
4344
//propertyFilters.GetArrayElementAtIndex(propertyFilters.arraySize - 1) = null;
4445
}
4546
EditorGUILayout.EndHorizontal();
47+
EditorGUI.indentLevel--;
4648
}
4749

4850
EditorGUI.EndProperty();

sdkproject/Assets/Mapbox/Unity/Editor/PropertyDrawers/VectorLayerPropertiesDrawer.cs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ bool ShowOthers
3232
{
3333
get
3434
{
35-
return EditorPrefs.GetBool("VectorLayerProperties_showPosition");
35+
return EditorPrefs.GetBool("VectorLayerProperties_showOthers");
3636
}
3737
set
3838
{
39-
EditorPrefs.SetBool("VectorLayerProperties_showPosition", value);
39+
EditorPrefs.SetBool("VectorLayerProperties_showOthers", value);
4040
}
4141
}
4242

@@ -204,6 +204,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
204204
void DrawLayerVisualizerProperties(SerializedProperty layerProperty)
205205
{
206206
GUILayout.Label("Vector Layer Visualizer Properties");
207+
EditorGUI.indentLevel++;
207208
GUILayout.BeginVertical();
208209

209210
var subLayerCoreOptions = layerProperty.FindPropertyRelative("coreOptions");
@@ -219,20 +220,22 @@ void DrawLayerVisualizerProperties(SerializedProperty layerProperty)
219220
}
220221
//EditorGUI.indentLevel--;
221222
ShowOthers = EditorGUILayout.Foldout(ShowOthers, "Advanced");
222-
//EditorGUI.indentLevel++;
223+
EditorGUI.indentLevel++;
223224
if (ShowOthers)
224225
{
225226
if (primitiveTypeProp == VectorPrimitiveType.Polygon)
226227
{
228+
EditorGUI.indentLevel--;
227229
EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("buildingsWithUniqueIds"), new GUIContent { text = "Buildings With Unique Ids", tooltip = "Turn on this setting only when rendering 3D buildings from the Mapbox Streets with Building Ids tileset. Using this setting with any other polygon layers or source will result in visual artifacts. " });
230+
EditorGUI.indentLevel++;
228231
}
229232
EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("filterOptions"), new GUIContent("Filters"));
230233
//EditorGUILayout.PropertyField(layerProperty.FindPropertyRelative("modifierOptions"), new GUIContent("Modifiers"));
231234
DrawModifiers(layerProperty, new GUIContent { text = "Modifier Options", tooltip = "Additional Feature modifiers to apply to the visualizer. " });
232-
//EditorGUI.indentLevel--;
233235
}
234-
236+
EditorGUI.indentLevel--;
235237
GUILayout.EndVertical();
238+
EditorGUI.indentLevel--;
236239
}
237240

238241
void DrawModifiers(SerializedProperty property, GUIContent label)
@@ -263,7 +266,6 @@ void DrawModifiers(SerializedProperty property, GUIContent label)
263266
var ind = i;
264267
EditorGUILayout.BeginHorizontal();
265268
EditorGUILayout.BeginVertical();
266-
//GUILayout.Space(5);
267269
meshfac.GetArrayElementAtIndex(ind).objectReferenceValue = EditorGUILayout.ObjectField(meshfac.GetArrayElementAtIndex(i).objectReferenceValue, typeof(MeshModifier), false) as ScriptableObject;
268270
EditorGUILayout.EndVertical();
269271
if (GUILayout.Button(new GUIContent("+"), (GUIStyle)"minibuttonleft", GUILayout.Width(30)))
@@ -278,7 +280,9 @@ void DrawModifiers(SerializedProperty property, GUIContent label)
278280
}
279281

280282
EditorGUILayout.Space();
283+
EditorGUI.indentLevel++;
281284
EditorGUILayout.BeginHorizontal();
285+
GUILayout.Space(EditorGUI.indentLevel * 12);
282286
if (GUILayout.Button(new GUIContent("Add New Empty"), (GUIStyle)"minibuttonleft"))
283287
{
284288
meshfac.arraySize++;
@@ -289,7 +293,7 @@ void DrawModifiers(SerializedProperty property, GUIContent label)
289293
ScriptableCreatorWindow.Open(typeof(MeshModifier), meshfac);
290294
}
291295
EditorGUILayout.EndHorizontal();
292-
296+
EditorGUI.indentLevel--;
293297
EditorGUILayout.Space();
294298
EditorGUILayout.LabelField(new GUIContent { text = "Game Object Modifiers", tooltip = "Modifiers that manipulate the GameObject after mesh generation." });
295299
var gofac = property.FindPropertyRelative("GoModifiers");
@@ -314,7 +318,9 @@ void DrawModifiers(SerializedProperty property, GUIContent label)
314318
}
315319

316320
EditorGUILayout.Space();
321+
EditorGUI.indentLevel++;
317322
EditorGUILayout.BeginHorizontal();
323+
GUILayout.Space(EditorGUI.indentLevel * 12);
318324
if (GUILayout.Button(new GUIContent("Add New Empty"), (GUIStyle)"minibuttonleft"))
319325
{
320326
gofac.arraySize++;
@@ -325,9 +331,9 @@ void DrawModifiers(SerializedProperty property, GUIContent label)
325331
ScriptableCreatorWindow.Open(typeof(GameObjectModifier), gofac);
326332
}
327333
EditorGUILayout.EndHorizontal();
328-
//GUILayout.EndArea();
334+
EditorGUI.indentLevel--;
329335
}
330-
//EditorGUI.indentLevel--;
336+
//
331337
EditorGUILayout.EndVertical();
332338
}
333339
}

0 commit comments

Comments
 (0)