# GetComponentCount(Entity)

> Gets the number of component types associated with an entity.

## Definition

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

```csharp
public int GetComponentCount(Entity entity)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.

### Returns

| Type                                                       | Description               |
| ---------------------------------------------------------- | ------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of components. |
