Description
The IsValid
property of the MeshVertex
struct in the Editor.MeshEditor
namespace is a boolean property that indicates whether the vertex is valid within the context of its associated mesh component. This property is virtual, sealed, and publicly accessible, but it is hidden from the editor and ignored during JSON serialization due to the Sandbox.HideAttribute
and System.Text.Json.Serialization.JsonIgnoreAttribute
attributes.
Usage
Use the IsValid
property to check if a MeshVertex
is valid before performing operations that require a valid vertex. This can help prevent errors or exceptions that may occur when working with invalid vertices.
Example
// Example of checking if a MeshVertex is valid
MeshVertex vertex = new MeshVertex();
if (vertex.IsValid)
{
// Perform operations on the valid vertex
// Example: Access vertex properties or methods
}
else
{
// Handle the invalid vertex case
// Example: Log a warning or skip processing
}