# Equals

> Compares two component instances to one another

## Definition

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

## Equals\<T>(T, T)

Compares two component instances to one another

```csharp
public static bool Equals<T>(ref T left, ref T right) where T : struct
```

### Parameters

**** (T): Left-hand side of the comparison**** (T): Right-hand side of the comparison

### Returns

| Type                                                          | Description                          |
| ------------------------------------------------------------- | ------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the types are equal. |

## Equals(void\*, void\*, TypeIndex)

Compares two component instances to one another

```csharp
public static bool Equals(void* left, void* right, TypeIndex typeIndex)
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): Left-hand side of the comparison**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): Right-hand side of the comparison**** (\[TypeIndex]\(/engine/7000.0/script-reference/unity/entities/typeindex)): TypeIndex for the two instances being compared

### Returns

| Type                                                          | Description                          |
| ------------------------------------------------------------- | ------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the types are equal. |

## Equals(Object, Object, TypeIndex)

Compares two component instances to one another

```csharp
public static bool Equals(object left, object right, TypeIndex typeIndex)
```

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): Left-hand side of the comparison**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): Right-hand side of the comparison**** (\[TypeIndex]\(/engine/7000.0/script-reference/unity/entities/typeindex)): TypeIndex for the two instances being compared

### Returns

| Type                                                          | Description                          |
| ------------------------------------------------------------- | ------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the types are equal. |

## Equals(Object, void\*, TypeIndex)

Compares two component instances to one another

```csharp
public static bool Equals(object left, void* right, TypeIndex typeIndex)
```

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): Left-hand side of the comparison**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): Right-hand side of the comparison**** (\[TypeIndex]\(/engine/7000.0/script-reference/unity/entities/typeindex)): TypeIndex for the two instances being compared

### Returns

| Type                                                          | Description                          |
| ------------------------------------------------------------- | ------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the types are equal. |
