# Equals

> Entity instances are equal if they refer to the same entity.

## Definition

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

## Equals(Object)

Entity instances are equal if they refer to the same entity.

```csharp
public override bool Equals(object compare)
```

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The object to compare to this Entity.

### Returns

| Type                                                          | Description                                                                                                |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True, if the compare parameter contains an Entity object having the same Index and Version as this Entity. |

## Equals(Entity)

Entity instances are equal if they represent the same entity.

```csharp
public bool Equals(Entity entity)
```

### Parameters

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

### Returns

| Type                                                          | Description                                                    |
| ------------------------------------------------------------- | -------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True, if the Entity instances have the same Index and Version. |
