docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method ClonePrefabWithHideFlags

    ClonePrefabWithHideFlags(GameObject, Transform)

    Clones the Prefab Game Object prefab and copies the hide flags of each Game Object in its hierarchy to the corresponding Game Object in the copy's hierarchy.

    Declaration
    public static GameObject ClonePrefabWithHideFlags(GameObject prefab, Transform parent = null)
    Parameters
    Type Name Description
    GameObject prefab

    The Prefab Game Object to make a copy of

    Transform parent

    Optional parent that will be assigned to the clone of the original Game Object

    Returns
    Type Description
    GameObject

    The clone of the original Game Object

    See Also
    InstantiatePrefab(Object, Transform)
    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)