docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method MoveEntitiesFrom

    MoveEntitiesFrom(EntityManager)

    Moves all entities managed by the specified EntityManager to the world of this EntityManager.

    Declaration
    [ExcludeFromBurstCompatTesting("Accesses managed component store")]
    public void MoveEntitiesFrom(EntityManager srcEntities)
    Parameters
    Type Name Description
    EntityManager srcEntities

    The EntityManager whose entities are appropriated.

    Remarks

    The entities moved are owned by this EntityManager.

    Each World has one EntityManager, which manages all the entities in that world. This function allows you to transfer entities from one World to another.

    Important: This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before moving the entity. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

    MoveEntitiesFrom(out NativeArray<Entity>, EntityManager)

    Moves all entities managed by the specified EntityManager to the World of this EntityManager and fills an array with their Entity objects.

    Declaration
    [ExcludeFromBurstCompatTesting("Accesses managed component store")]
    public void MoveEntitiesFrom(out NativeArray<Entity> output, EntityManager srcEntities)
    Parameters
    Type Name Description
    NativeArray<Entity> output

    An array to receive the Entity objects of the transferred entities.

    EntityManager srcEntities

    The EntityManager whose entities are appropriated.

    Remarks

    After the move, the entities are managed by this EntityManager. Use the output array to make post-move changes to the transferred entities.

    Each world has one EntityManager, which manages all the entities in that world. This function allows you to transfer entities from one World to another.

    Important: This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before moving the entity. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

    MoveEntitiesFrom(out NativeArray<Entity>, EntityManager, NativeArray<EntityRemapInfo>)

    Moves all entities managed by the specified EntityManager to the World of this EntityManager and fills an array with their Entity objects.

    Declaration
    [ExcludeFromBurstCompatTesting("Accesses managed component store")]
    public void MoveEntitiesFrom(out NativeArray<Entity> output, EntityManager srcEntities, NativeArray<EntityRemapUtility.EntityRemapInfo> entityRemapping)
    Parameters
    Type Name Description
    NativeArray<Entity> output

    An array to receive the Entity objects of the transferred entities.

    EntityManager srcEntities

    The EntityManager whose entities are appropriated.

    NativeArray<EntityRemapUtility.EntityRemapInfo> entityRemapping

    A set of entity transformations to make during the transfer.

    Remarks

    After the move, the entities are managed by this EntityManager. Use the output array to make post-move changes to the transferred entities.

    Each world has one EntityManager, which manages all the entities in that world. This function allows you to transfer entities from one World to another.

    Important: This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before moving the entity. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

    Exceptions
    Type Condition
    ArgumentException

    MoveEntitiesFrom(EntityManager, NativeArray<EntityRemapInfo>)

    Moves all entities managed by the specified EntityManager to the World of this EntityManager.

    Declaration
    [ExcludeFromBurstCompatTesting("Accesses managed component store")]
    public void MoveEntitiesFrom(EntityManager srcEntities, NativeArray<EntityRemapUtility.EntityRemapInfo> entityRemapping)
    Parameters
    Type Name Description
    EntityManager srcEntities

    The EntityManager whose entities are appropriated.

    NativeArray<EntityRemapUtility.EntityRemapInfo> entityRemapping

    A set of entity transformations to make during the transfer.

    Remarks

    After the move, the entities are managed by this EntityManager.

    Each World has one EntityManager, which manages all the entities in that world. This function allows you to transfer entities from one world to another.

    Important: This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before moving the entity. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if you attempt to transfer entities to the EntityManager that already owns them.

    MoveEntitiesFrom(EntityManager, EntityQuery)

    Moves a selection of the entities managed by the specified EntityManager to the World of this EntityManager and fills an array with their Entity objects.

    Declaration
    [ExcludeFromBurstCompatTesting("Accesses managed component store")]
    public void MoveEntitiesFrom(EntityManager srcEntities, EntityQuery filter)
    Parameters
    Type Name Description
    EntityManager srcEntities

    The EntityManager whose entities are appropriated.

    EntityQuery filter

    A EntityQuery that defines the entities to move. Must be part of the source World. This query must not reference any types that implement IEnableableComponent.

    Remarks

    After the move, the entities are managed by this EntityManager. Use the output array to make post-move changes to the transferred entities.

    Each world has one EntityManager, which manages all the entities in that world. This function allows you to transfer entities from one World to another.

    Important: This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before moving the entity. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

    Exceptions
    Type Condition
    ArgumentException

    MoveEntitiesFrom(out NativeArray<Entity>, EntityManager, EntityQuery, NativeArray<EntityRemapInfo>)

    Moves a selection of the entities managed by the specified EntityManager to the World of this EntityManager and fills an array with their Entity objects.

    Declaration
    [ExcludeFromBurstCompatTesting("Accesses managed component store")]
    public void MoveEntitiesFrom(out NativeArray<Entity> output, EntityManager srcEntities, EntityQuery filter, NativeArray<EntityRemapUtility.EntityRemapInfo> entityRemapping)
    Parameters
    Type Name Description
    NativeArray<Entity> output

    An array to receive the Entity objects of the transferred entities.

    EntityManager srcEntities

    The EntityManager whose entities are appropriated.

    EntityQuery filter

    A EntityQuery that defines the entities to move. Must be part of the source World. This query must not reference any types that implement IEnableableComponent.

    NativeArray<EntityRemapUtility.EntityRemapInfo> entityRemapping

    A set of entity transformations to make during the transfer.

    Remarks

    After the move, the entities are managed by this EntityManager. Use the output array to make post-move changes to the transferred entities.

    Each world has one EntityManager, which manages all the entities in that world. This function allows you to transfer entities from one World to another.

    Important: This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before moving the entity. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

    Exceptions
    Type Condition
    ArgumentException

    MoveEntitiesFrom(EntityManager, EntityQuery, NativeArray<EntityRemapInfo>)

    Moves a selection of the entities managed by the specified EntityManager to the World of this EntityManager.

    Declaration
    [ExcludeFromBurstCompatTesting("Accesses managed component store")]
    public void MoveEntitiesFrom(EntityManager srcEntities, EntityQuery filter, NativeArray<EntityRemapUtility.EntityRemapInfo> entityRemapping)
    Parameters
    Type Name Description
    EntityManager srcEntities

    The EntityManager whose entities are appropriated.

    EntityQuery filter

    A EntityQuery that defines the entities to move. Must be part of the source World. This query must not reference any types that implement IEnableableComponent.

    NativeArray<EntityRemapUtility.EntityRemapInfo> entityRemapping

    A set of entity transformations to make during the transfer.

    Remarks

    After the move, the entities are managed by this EntityManager.

    Each world has one EntityManager, which manages all the entities in that world. This function allows you to transfer entities from one World to another.

    Important: This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before moving the entity. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if the EntityQuery object used as the filter comes from a different world than the srcEntities EntityManager.

    MoveEntitiesFrom(out NativeArray<Entity>, EntityManager, EntityQuery)

    Moves a selection of the entities managed by the specified EntityManager to the World of this EntityManager and fills an array with their Entity objects.

    Declaration
    [ExcludeFromBurstCompatTesting("Accesses managed component store")]
    public void MoveEntitiesFrom(out NativeArray<Entity> output, EntityManager srcEntities, EntityQuery filter)
    Parameters
    Type Name Description
    NativeArray<Entity> output

    An array to receive the Entity objects of the transferred entities.

    EntityManager srcEntities

    The EntityManager whose entities are appropriated.

    EntityQuery filter

    A EntityQuery that defines the entities to move. Must be part of the source World. This query must not reference any types that implement IEnableableComponent.

    Remarks

    After the move, the entities are managed by this EntityManager. Use the output array to make post-move changes to the transferred entities.

    Each world has one EntityManager, which manages all the entities in that world. This function allows you to transfer entities from one World to another.

    Important: This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before moving the entity. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

    Exceptions
    Type Condition
    ArgumentException
    In This Article
    Back to top
    Copyright © 2025 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)