docs.unity3d.com
    Show / Hide Table of Contents

    Class CombineMeshes

    Provides methods for merging multiple ProBuilderMesh objects into a single mesh.

    Inheritance
    Object
    CombineMeshes
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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
    IEnumerable<ProBuilderMesh> meshes

    A collection of meshes to merge. This collection should include the meshTarget object.

    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 meshTarget. However it can be multiple in cases where the resulting vertex count exceeds the maximum allowable value.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023