# Equals

> Indicates whether the current StateReference is equal to another StateReference.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor.GraphVisualization](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization.md)
* **Assembly:** UnityEditor

## Equals(StateReference)

Indicates whether the current [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md) is equal to another [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md).

```csharp
public bool Equals(StateReference other)
```

### Parameters

**** (\[StateReference]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference)): The other [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md) to compare with the current instance.

### Returns

| Type                                                          | Description                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true if both references share the same [StateReference.StateID](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference/stateid.md) and refer to the same [StateReference.Context](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference/context.md) instance. Otherwise, false. |

## Equals(Object)

Indicates whether the current [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md) is equal to another object.

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

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The object to compare with the current [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md).

### Returns

| Type                                                          | Description                                                                                                                                                                          |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true if `obj` is a [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md) equal to the current instance. Otherwise, false. |
