# GetComponentTypes

> Gets the types of the components making up this archetype.

## Definition

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

## GetComponentTypes(Allocator)

Gets the types of the components making up this archetype.

```csharp
public NativeArray<ComponentType> GetComponentTypes(Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[Allocator]\(/engine/7000.0/script-reference/unity/collections/allocator)): The allocation type to use for the returned NativeArray.

### Returns

| Type                                                                                             | Description                                                                                                                               |
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<ComponentType>](/engine/7000.0/script-reference/unity/collections/nativearray1.md) | A native array containing the [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) objects of this archetype. |

### Remarks

The set of component types in an archetype cannot change; adding components to an entity or removing components from an entity changes the archetype of that entity (possibly resulting in the creation of a new archetype). The original archetype remains unchanged.

## GetComponentTypes(AllocatorHandle)

Gets the types of the components making up this archetype.

```csharp
public NativeArray<ComponentType> GetComponentTypes(AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[AllocatorHandle]\(/engine/7000.0/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocation type to use for the returned NativeArray.

### Returns

| Type                                                                                             | Description                                                                                                                               |
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<ComponentType>](/engine/7000.0/script-reference/unity/collections/nativearray1.md) | A native array containing the [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) objects of this archetype. |

### Remarks

The set of component types in an archetype cannot change; adding components to an entity or removing components from an entity changes the archetype of that entity (possibly resulting in the creation of a new archetype). The original archetype remains unchanged.
