docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CombineMeshes

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

    Inheritance
    object
    CombineMeshes
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.ProBuilder.MeshOperations
    Assembly: Unity.ProBuilder.dll
    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). This mesh must be present in the meshes collection.

    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)