Class CombineMeshes
Provides methods for merging multiple ProBuilderMesh objects into a single mesh.
Inherited Members
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public static class CombineMeshes
Methods
Combine(IEnumerable<ProBuilderMesh>, ProBuilderMesh)
Merges a collection of ProBuilderMesh objects into as few meshes as possible. It re-uses the meshTarget
object as the first
destination for the first maxVertexCount -1 vertices. If the sum of vertices is above maxVertexCount - 1,
it generates new meshes unless there is a single mesh left. In that case it appends it to the return list.
Declaration
public static List<ProBuilderMesh> Combine(IEnumerable<ProBuilderMesh> meshes, ProBuilderMesh meshTarget)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ProBuilderMesh> | meshes | A collection of meshes to merge. This collection should include the |
ProBuilderMesh | meshTarget | A mesh to use as the starting point for merging and which will be kept as a reference (target). |
Returns
Type | Description |
---|---|
List<ProBuilderMesh> | A list of merged meshes. In most cases this is a single mesh corresponding to |