Skip to content

Commit 1a4b193

Browse files
authored
fix mesh indexes, add tooltip to ping buttons
thanks @memo-mgh
1 parent 7248084 commit 1a4b193

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ void OnGUI()
3636
if (selection == null)
3737
{
3838
EditorGUILayout.LabelField("Select gameobject from scene or hierarchy..");
39-
4039
}
4140
else
4241
{
@@ -76,7 +75,7 @@ void OnGUI()
7675
EditorGUILayout.Space();
7776
EditorGUILayout.LabelField("TOP 20", EditorStyles.boldLabel);
7877

79-
// top 10
78+
// top list
8079
if (meshes != null && sortedTopList != null)
8180
{
8281
int i = 0;
@@ -85,11 +84,11 @@ void OnGUI()
8584
int percent = (int)(item.Value / (float)totalVertices * 100f);
8685
EditorGUILayout.BeginHorizontal();
8786
// ping button
88-
if (GUILayout.Button(" ", GUILayout.Width(16)))
87+
if (GUILayout.Button(new GUIContent(" ", "Ping"), GUILayout.Width(16)))
8988
{
90-
EditorGUIUtility.PingObject(meshes[i].transform);
89+
EditorGUIUtility.PingObject(meshes[item.Key].transform);
9190
}
92-
EditorGUILayout.LabelField(meshes[i].name + " = " + item.Value + " (" + percent + "%)");
91+
EditorGUILayout.LabelField(meshes[item.Key].name + " = " + item.Value + " (" + percent + "%)");
9392
GUILayout.ExpandWidth(true);
9493
EditorGUILayout.EndHorizontal();
9594

0 commit comments

Comments
 (0)