docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method CloneMaterials

    CloneMaterials(Renderer)

    Clones and replaces all materials assigned to a Renderer

    Declaration
    public static Material[] CloneMaterials(Renderer renderer)
    Parameters
    Type Name Description
    Renderer renderer

    Renderer assigned the materials to clone and replace.

    Returns
    Type Description
    Material[]

    Cloned materials

    Remarks
    Warning

    You must call Destroy(Object, bool) on each cloned material object in the array when done.

    See Also
    materials
    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)