docs.unity.cn
    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 Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Tuesday, June 13, 2023