# GetNativeArray

> Provides a native array interface to entity instances stored in this chunk.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

## GetNativeArray(EntityTypeHandle)

Provides a native array interface to entity instances stored in this chunk.

```csharp
public readonly NativeArray<Entity> GetNativeArray(EntityTypeHandle entityTypeHandle)
```

### Parameters

**** (\[EntityTypeHandle]\(/engine/7000.0/script-reference/unity/entities/entitytypehandle)): An object containing type and job safety information. To create this object, call [ComponentSystemBase.GetEntityTypeHandle()](/engine/7000.0/script-reference/unity/entities/componentsystembase/getentitytypehandle.md). Pass the object to a job using a public field you define as part of the job struct.

### Returns

| Type                                                                                      | Description                                          |
| ----------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [NativeArray\<Entity>](/engine/7000.0/script-reference/unity/collections/nativearray1.md) | 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.

```csharp
public readonly NativeArray<T> GetNativeArray<T>(ref ComponentTypeHandle<T> typeHandle) where T : unmanaged, IComponentData
```

### Parameters

**** (\[ComponentTypeHandle\<T>]\(/engine/7000.0/script-reference/unity/entities/componenttypehandle1)): An object containing type and job safety information. To create this object, call [ComponentSystemBase.GetComponentTypeHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/getcomponenttypehandle.md). Pass the object to a job using a public field you define as part of the job struct.

### Returns

| Type                                                                                 | Description                                            |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------ |
| [NativeArray\<T>](/engine/7000.0/script-reference/unity/collections/nativearray1.md) | 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](/engine/7000.0/script-reference/unity/entities/archetypechunk/getcomponentdataptrro.md) and [ArchetypeChunk.GetComponentDataPtrRW](/engine/7000.0/script-reference/unity/entities/archetypechunk/getcomponentdataptrrw.md).
