111
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ShowTrisCount : MonoBehaviour
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
int totalFaces = 0;
|
||||
MeshFilter[] meshFilters = FindObjectsOfType<MeshFilter>();
|
||||
|
||||
foreach (MeshFilter m in meshFilters)
|
||||
{
|
||||
if(m.mesh && m.mesh.isReadable)
|
||||
{
|
||||
totalFaces += m.mesh.triangles.Length / 3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Debug.Log("Total faces in the scene: " + totalFaces);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user