private void DrawStatisticGUI() { string label = "Statistic"; string id = "statistic" + instance.GetInstanceID(); GEditorCommon.Foldout(label, true, id, () => { List <string> keys = instance.GetKeys(); int geoMeshCount = 0; int grassMeshCount = 0; for (int i = 0; i < keys.Count; ++i) { if (keys[i].StartsWith(GCommon.CHUNK_MESH_NAME_PREFIX)) { geoMeshCount += 1; } else if (keys[i].StartsWith(GCommon.GRASS_MESH_NAME_PREFIX)) { grassMeshCount += 1; } } EditorGUILayout.LabelField("Geometry Mesh", geoMeshCount.ToString()); EditorGUILayout.LabelField("Grass Mesh", grassMeshCount.ToString()); string filePath = AssetDatabase.GetAssetPath(instance); FileInfo fileInfo = new FileInfo(filePath); if (fileInfo != null) { long length = fileInfo.Length; EditorGUILayout.LabelField("Size", string.Format("{0} MB", (length / 1000000).ToString("0.00"))); } }); }
private void DrawStatisticGUI() { string label = "Statistic"; string id = "statistic" + instance.GetInstanceID(); GEditorCommon.Foldout(label, true, id, () => { string filePath = AssetDatabase.GetAssetPath(instance); FileInfo fileInfo = new FileInfo(filePath); if (fileInfo != null) { long length = fileInfo.Length; EditorGUILayout.LabelField("Size", string.Format("{0} MB", (length / 1000000).ToString("0.00"))); } }); }