Skip to content

Commit 1841cdd

Browse files
committed
Collapse paths into one
1 parent 7636b9d commit 1841cdd

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

Assets/MRTK/Core/Inspectors/ControllerPopupWindow.cs

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -319,35 +319,13 @@ private void RenderMappingList(List<string> controllerList)
319319
GUIStyle headerStyle = new GUIStyle();
320320
headerStyle.richText = true;
321321

322-
if (currentControllerOption == null || currentControllerTexture == null)
322+
using (new EditorGUILayout.VerticalScope())
323323
{
324-
using (new EditorGUILayout.VerticalScope())
325-
{
326-
GUILayout.FlexibleSpace();
327-
EditorGUILayout.LabelField("<b>Controllers affected by this mapping</b>", headerStyle);
328-
for (int i = 0; i < controllerList.Count; i++)
329-
{
330-
EditorGUILayout.LabelField(controllerList[i]);
331-
}
332-
}
333-
}
334-
else
335-
{
336-
float max_y = currentControllerOption.InputLabelPositions.Max(x => x.y);
337-
338-
var titleRectPosition = Vector2.up * (max_y + 4 * EditorGUIUtility.singleLineHeight);
339-
var titleRectSize = new Vector2(500, EditorGUIUtility.singleLineHeight);
340-
341-
var titleRect = new Rect(titleRectPosition, titleRectSize);
342-
EditorGUI.LabelField(titleRect, "<b>Controllers affected by this mapping</b>", headerStyle);
343-
324+
GUILayout.FlexibleSpace();
325+
EditorGUILayout.LabelField("<b>Controllers affected by this mapping</b>", headerStyle);
344326
for (int i = 0; i < controllerList.Count; i++)
345327
{
346-
var rectPosition = Vector2.up * (max_y + (i + 5) * EditorGUIUtility.singleLineHeight);
347-
var rectSize = new Vector2(1000, EditorGUIUtility.singleLineHeight);
348-
349-
var labelRect = new Rect(rectPosition, rectSize);
350-
EditorGUI.LabelField(labelRect, controllerList[i]);
328+
EditorGUILayout.LabelField(controllerList[i]);
351329
}
352330
}
353331
}

0 commit comments

Comments
 (0)