docs.unity.cn
    Show / Hide Table of Contents

    Method DeclareReferencedPrefab

    DeclareReferencedPrefab(GameObject)

    DeclareReferencedPrefab includes the referenced Prefab in the conversion process. Once it has been declared, you can use GetPrimaryEntity to find the Entity for the Prefab. If the object is a Prefab, all Entities in it will be made part of a LinkedEntityGroup, thus Instantiate will clone the whole group. All Entities in the Prefab will also be tagged with the Prefab component thus will not be picked up by an EntityQuery by default.

    Declaration
    public void DeclareReferencedPrefab(GameObject prefab)
    Parameters
    Type Name Description
    GameObject prefab
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on 04 August 2022
    Terms of use