How the Check Works
The CheckExcessivePolygonCounts
is designed to detect extremely high polygon counts in Mesh objects within your project. It examines the polygon count of individual Meshes and compares them against a specified maximum limit.
The check operates as follows:
- Maximum Count Definition: You can set the maximum allowed polygon count. This value can be customized to suit your project’s requirements.
- Mesh Inspection: The check inspects each GameObject with a MeshFilter component.
- Polygon Count Calculation: It calculates the polygon count of each Mesh.
- Comparison: Compares the polygon count against the specified maximum count.
- Issue Identification: If a Mesh’s polygon count exceeds the specified maximum, the check logs it as an issue.
When to Use This Check
- Performance and Memory Optimization: To identify Meshes with excessively high polygon counts that could lead to performance or memory issues.
How to Use the Check
- Maximum Count Configuration: Define the maximum allowed polygon count.
- Perform Checks on GameObjects: Attach the
CheckExcessivePolygonCounts
component to GameObjects in your scene or prefab that have Meshes you want to inspect. During runtime or when manually triggered, this check will calculate the polygon count of the Meshes and log issues if they exceed the maximum count.
Methods
DrawSpecificProfileEditor()
: Custom method for configuring the maximum allowed polygon count.PerformCheck(GameObject gameObject)
: Initiates the verification process for a GameObject. It calculates the polygon count of the Mesh attached to the GameObject and logs an issue if it exceeds the specified maximum count.PerformCheck(Mesh sobj)
: Initiates the verification process for a Mesh object directly. It calculates the polygon count of the Mesh and logs an issue if it exceeds the specified maximum count.
Attributes
longDescription
: Provides a description of what this check does, explaining its purpose in detecting excessively high polygon counts in Mesh objects.