Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

EntityManager.GetAllEntities

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public NativeArray<Entity> GetAllEntities(Allocator allocator);

Parameters

Parameter Description
allocator The type of allocation for creating the NativeArray to hold the Entity objects.

Returns

NativeArray<Entity> An array of Entity objects referring to all the entities in the World.

Description

Gets all the entities managed by this EntityManager.

Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before getting the entities 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.


Declaration

public NativeArray<Entity> GetAllEntities(AllocatorHandle allocator);

Parameters

Parameter Description
allocator The type of allocation for creating the NativeArray to hold the Entity objects.

Returns

NativeArray<Entity> An array of Entity objects referring to all the entities in the World.

Description

Gets all the entities managed by this EntityManager.

Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before getting the entities 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.


Declaration

public NativeArray<Entity> GetAllEntities(AllocatorHandle allocator, GetAllEntitiesOptions options);

Parameters

Parameter Description
allocator The type of allocation for creating the NativeArray to hold the Entity objects.
options Specifies whether entities from chunk components should be included.

Returns

NativeArray<Entity> An array of Entity objects referring to all the entities in the World.

Description

Gets all the entities managed by this EntityManager.

Important: This function creates a sync point, which means that the EntityManager waits for all currently running Jobs to complete before getting the entities 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.