Class MergeElements
Provides methods for merging multiple faces of a ProBuilderMesh to a single face.
Inherited Members
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public static class MergeElements
Methods
Merge(ProBuilderMesh, IEnumerable<Face>)
Merges a collection of faces into a single face. This function does not perform any sanity checks: it just merges faces, so the caller must make sure that the input is valid. This method also removes duplicate vertices created as a result of merging previously common vertices.
This is the equivalent of the Merge Faces action.
Declaration
public static Face Merge(ProBuilderMesh target, IEnumerable<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | target | The source mesh. |
System.Collections.Generic.IEnumerable<Face> | faces | The collection of faces to move. |
Returns
Type | Description |
---|---|
Face | The single merged Face. |
MergePairs(ProBuilderMesh, IEnumerable<SimpleTuple<Face, Face>>, Boolean)
Merges each pair of faces into a single face. Indexes are combined, but otherwise the properties of the first face in the pair take precedence.
This is the equivalent of the Merge Faces action.
Declaration
public static List<Face> MergePairs(ProBuilderMesh target, IEnumerable<SimpleTuple<Face, Face>> pairs, bool collapseCoincidentVertices = true)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | target | The source mesh. |
System.Collections.Generic.IEnumerable<SimpleTuple<Face, Face>> | pairs | The list of face pairs to merge. |
Boolean | collapseCoincidentVertices | True to condense coincident vertex positions on each face. |
Returns
Type | Description |
---|---|
List<Face> | A list of the new faces created. |