Skip to content

Instantly share code, notes, and snippets.

@twobob
Created April 15, 2017 03:06
Show Gist options
  • Save twobob/ce800e96b76e8949ee587fb4f19f2d17 to your computer and use it in GitHub Desktop.
Save twobob/ce800e96b76e8949ee587fb4f19f2d17 to your computer and use it in GitHub Desktop.
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