From 3c2c49dbef7349e5847171f63197fe4796e42002 Mon Sep 17 00:00:00 2001 From: HuangWei Date: Tue, 12 Jan 2021 17:45:55 +0800 Subject: [PATCH 1/2] Add thousand separators in GetSelectedMeshInfo --- Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs b/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs index d8ddcf3..f9479f9 100644 --- a/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs +++ b/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs @@ -1,5 +1,6 @@ // display selected gameobject mesh stats (should work on prefabs,models in project window also) +using System; using System.Collections.Generic; using System.Linq; using UnityEditor; @@ -69,9 +70,10 @@ void OnGUI() } // display stats - EditorGUILayout.LabelField("Meshes: " + totalMeshes); - EditorGUILayout.LabelField("Vertices: " + totalVertices); - EditorGUILayout.LabelField("Triangles: " + totalTris); + // String.Format("{0:n0}", 9876); // No digits after the decimal point. Output: 9,876 + EditorGUILayout.LabelField("Meshes: " + $"{totalMeshes:n0}"); + EditorGUILayout.LabelField("Vertices: " + $"{totalVertices:n0}"); + EditorGUILayout.LabelField("Triangles: " + $"{totalTris:n0}"); EditorGUILayout.Space(); EditorGUILayout.LabelField("TOP 20", EditorStyles.boldLabel); @@ -88,7 +90,7 @@ void OnGUI() { EditorGUIUtility.PingObject(meshes[item.Key].transform); } - EditorGUILayout.LabelField(meshes[item.Key].name + " = " + item.Value + " (" + percent + "%)"); + EditorGUILayout.LabelField(meshes[item.Key].name + " = " + $"{item.Value:n0}" + " (" + percent + "%)"); GUILayout.ExpandWidth(true); EditorGUILayout.EndHorizontal(); From a6b46fcb6a8bc4daaa24c2c3f207ce4c0977953d Mon Sep 17 00:00:00 2001 From: HuangWei Date: Tue, 12 Jan 2021 17:48:24 +0800 Subject: [PATCH 2/2] Remove unused import --- Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs b/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs index f9479f9..e12f971 100644 --- a/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs +++ b/Assets/Scripts/Editor/Tools/GetSelectedMeshInfo.cs @@ -1,6 +1,5 @@ // display selected gameobject mesh stats (should work on prefabs,models in project window also) -using System; using System.Collections.Generic; using System.Linq; using UnityEditor;