Class EditorMeshUtility | ProBuilder | 4.3.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class EditorMeshUtility

    Mesh editing helper functions that are only available in the Editor.

    Inheritance
    Object
    EditorMeshUtility
    Namespace: UnityEditor.ProBuilder
    Syntax
    public static class EditorMeshUtility

    Methods

    Optimize(ProBuilderMesh, Boolean)

    Optmizes the mesh geometry, and generates a UV2 channel (if object is marked as LightmapStatic, or generateLightmapUVs is true).

    Declaration
    public static void Optimize(this ProBuilderMesh mesh, bool generateLightmapUVs = false)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The ProBuilder mesh component to be optimized.

    Boolean generateLightmapUVs

    If the Auto UV2 preference is disabled this parameter can be used to force UV2s to be built.

    Remarks

    This is only applicable to meshes with triangle topology. Quad meshes are not affected by this function.

    RebuildColliders(ProBuilderMesh)

    Resize any collider components on this mesh to match the size of the mesh bounds.

    Declaration
    public static void RebuildColliders(this ProBuilderMesh mesh)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh target to rebuild collider volumes for.

    Events

    meshOptimized

    Declaration
    public static event Action<ProBuilderMesh, Mesh> meshOptimized
    Event Type
    Type Description
    Action<ProBuilderMesh, Mesh>

    This callback is raised after a ProBuilderMesh has been successfully optimized.

    See Also
    Optimize(ProBuilderMesh, Boolean)
    In This Article
    • Methods
      • Optimize(ProBuilderMesh, Boolean)
      • RebuildColliders(ProBuilderMesh)
    • Events
      • meshOptimized
    Back to top
    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