Skip to content

Instantly share code, notes, and snippets.

@naokirin
Created July 5, 2016 23:24
Show Gist options
  • Save naokirin/860e948d8eefd70912fb3b14956ca45d to your computer and use it in GitHub Desktop.
Save naokirin/860e948d8eefd70912fb3b14956ca45d to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MeshFilter))]
public class MeshInformation : Editor
{
public override void OnInspectorGUI()
{
var filter = target as MeshFilter;
string message = "Triangles: " + filter.sharedMesh.triangles.Length / 3 + " Vertices: " + filter.sharedMesh.vertices.Length;
EditorGUILayout.LabelField(message);
}
}
[CustomEditor(typeof(SkinnedMeshRenderer))]
public class SkinnedMeshInformation : Editor
{
public override void OnInspectorGUI()
{
var skin = target as SkinnedMeshRenderer;
string message = "Triangles: " + skin.sharedMesh.triangles.Length / 3 + " Vertices: " + skin.sharedMesh.vertices.Length;
EditorGUILayout.LabelField(message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment