Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class PolyPri : MonoBehaviour
{
void Start ()
{
MeshFilter[] myMeshs = FindObjectsOfType (typeof(MeshFilter)) as MeshFilter[];
List<MeshFilter> myMeshList = new List<MeshFilter> ();
for (int i = 0; i < myMeshs.Length; i++) {
myMeshList.Add (myMeshs [i]);
}
var lengths = from element in myMeshList
orderby element.mesh.vertexCount
select element;
foreach (MeshFilter value in lengths) {
print(value.gameObject.name + " " + value.mesh.vertexCount);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment