# GetComponentOrderVersion

> Gets the version number of the specified component type.

## Definition

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

## GetComponentOrderVersion\<T>()

Gets the version number of the specified component type.

```csharp
public int GetComponentOrderVersion<T>()
```

### Returns

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

### Remarks

This version number is incremented each time there is a structural change involving the specified type of component. Such changes include creating or destroying entities that have this component and adding or removing the component type from an entity. Shared components are not covered by this version; see [EntityManager.GetSharedComponentOrderVersion](/engine/7000.0/script-reference/unity/entities/entitymanager/getsharedcomponentorderversion.md).

Version numbers can overflow. To compare if one version is more recent than another, directly checking if VersionB is greater than VersionA is not sufficient. Instead, use the helper function:

bool VersionBisNewer = ChangeVersionUtility.DidChange(VersionB, VersionA);

## GetComponentOrderVersion(ComponentType)

Gets the version number of the specified component type.

```csharp
public int GetComponentOrderVersion(ComponentType componentType)
```

### Parameters

**** (\[ComponentType]\(/engine/7000.0/script-reference/unity/entities/componenttype)): The component type.

### Returns

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

### Remarks

This version number is incremented each time there is a structural change involving the specified type of component. Such changes include creating or destroying entities that have this component and adding or removing the component type from an entity. Shared components are not covered by this version. [EntityManager.GetSharedComponentOrderVersion](/engine/7000.0/script-reference/unity/entities/entitymanager/getsharedcomponentorderversion.md).

Version numbers can overflow. To compare if one version is more recent than another, directly checking if VersionB is greater than VersionA is not sufficient. Instead, use the helper function:

bool VersionBisNewer = ChangeVersionUtility.DidChange(VersionB, VersionA);
