22 lines
499 B
C#
22 lines
499 B
C#
|
|
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);
|
||
|
|
}
|
||
|
|
}
|