GetNativeArray
Provides a native array interface to entity instances stored in this chunk.
Read time 1 minuteLast updated a day ago
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
GetNativeArray(EntityTypeHandle)
Provides a native array interface to entity instances stored in this chunk.
public readonly NativeArray<Entity> GetNativeArray(EntityTypeHandle entityTypeHandle)
Parameters
An object containing type and job safety information. To create this object, call ComponentSystemBase.GetEntityTypeHandle(). Pass the object to a job using a public field you define as part of the job struct.
Returns
Type | Description |
|---|---|
| NativeArray<Entity> | A native array containing the entities in the chunk. |
Remarks
The native array returned by this method references existing data, not a copy.
GetNativeArray<T>(ComponentTypeHandle<T>)
Provides a native array interface to components stored in this chunk.
public readonly NativeArray<T> GetNativeArray<T>(ref ComponentTypeHandle<T> typeHandle) where T : unmanaged, IComponentData
Parameters
An object containing type and job safety information. To create this object, call ComponentSystemBase.GetComponentTypeHandle. Pass the object to a job using a public field you define as part of the job struct.
Returns
Type | Description |
|---|---|
| NativeArray<T> | A native array containing the components in the chunk. |
Remarks
The native array returned by this method references existing data, not a copy.
For raw unsafe access to a chunk's component data, see ArchetypeChunk.GetComponentDataPtrRO and ArchetypeChunk.GetComponentDataPtrRW.