Files
VR-WuKong/Assets/GameRes/Main/SceneArt/VRScene/Scripts/ShowTrisCount.cs
2025-11-14 18:44:06 +08:00

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);
}
}