Method MergeVertices
MergeVertices(ProBuilderMesh, int[], bool)
Collapses all specified indices to a single shared index.
This is equivalent to the Collapse Vertices action.
Declaration
public static int MergeVertices(this ProBuilderMesh mesh, int[] indexes, bool collapseToFirst = false)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | Target mesh. |
int[] | indexes | The indexes to merge to a single shared vertex. |
bool | collapseToFirst | True to collapse the vertices onto the first vertex position; false to merge all vertices to the average position. |
Returns
Type | Description |
---|---|
int | The first available local index created as a result of the merge, or -1 if action failed. |
Remarks
Retains vertex normals.