docs.unity3d.com
    Show / Hide Table of Contents

    Method CopyEntities

    CopyEntities(NativeArray<Entity>, NativeArray<Entity>)

    Clones a set of entities, different from Instantiate because it does not remove the prefab tag component.

    Declaration
    public void CopyEntities(NativeArray<Entity> srcEntities, NativeArray<Entity> outputEntities)
    Parameters
    Type Name Description
    NativeArray<Entity> srcEntities

    The set of entities to clone

    NativeArray<Entity> outputEntities

    the set of entities that were cloned. outputEntities.Length must match srcEntities.Length

    Remarks

    The new entity has the same archetype and component values as the original, however system state components are removed from the clone.

    Entity references on components that are being cloned to entities inside the set are remapped to the instantiated entities. This method overload ignores the LinkedEntityGroup component, since the group of entities that will be cloned is passed explicitly.

    Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before creating the entity and no additional Jobs can start before the function is finished. A sync point can cause a drop in performance because the ECS framework may not be able to make use of the processing power of all available cores.

    In This Article
    • CopyEntities(NativeArray<Entity>, NativeArray<Entity>)
    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