Class DeleteElements
Provides functions for removing vertices and triangles from a mesh.
Inherited Members
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public static class DeleteElements
Methods
DeleteFace(ProBuilderMesh, Face)
Removes a face from a mesh.
This is the equivalent of the Delete Faces action.
Declaration
public static int[] DeleteFace(this ProBuilderMesh mesh, Face face)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
Face | face | The face to remove. |
Returns
Type | Description |
---|---|
Int32[] | An array of vertex indices that ProBuilder deleted when it removed the specified face. |
DeleteFaces(ProBuilderMesh, IEnumerable<Face>)
Deletes a collection of faces from a mesh.
This is the equivalent of the Delete Faces action.
Declaration
public static int[] DeleteFaces(this ProBuilderMesh mesh, IEnumerable<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IEnumerable<Face> | faces | The faces to remove. |
Returns
Type | Description |
---|---|
Int32[] | An array of vertex indices that ProBuilder deleted when it removed the specified faces. |
DeleteFaces(ProBuilderMesh, IList<Int32>)
Deletes a list of faces from a mesh.
This is the equivalent of the Delete Faces action.
Declaration
public static int[] DeleteFaces(this ProBuilderMesh mesh, IList<int> faceIndexes)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IList<Int32> | faceIndexes | The indices of faces to remove (corresponding to the faces collection. |
Returns
Type | Description |
---|---|
Int32[] | An array of vertex indices that ProBuilder deleted when it removed the specified faces. |
DeleteVertices(ProBuilderMesh, IEnumerable<Int32>)
Deletes the vertices from the specified index array and rebuilds the sharedVertices array.
Declaration
public static void DeleteVertices(this ProBuilderMesh mesh, IEnumerable<int> distinctIndexes)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
IEnumerable<Int32> | distinctIndexes | A list of vertices to delete. Note that this must not contain duplicates. |
Remarks
This function does not retriangulate the mesh. This means that you are responsible for ensuring that the indexes deleted by this function are not referenced by any triangles.