# GetStateReference(Hash128)

> Returns a StateReference that identifies the state with the given ID within this visualization context.

## Definition

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

```csharp
public StateReference GetStateReference(Hash128 stateID)
```

### Parameters

**** (Hash128): The unique identifier of the state to reference.

### Returns

| Type                                                                                                             | Description                                                                                                                                                                                                                                                                       |
| ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md) | A [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md) that targets the state identified by `stateID` within this [Context](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md). |

### Remarks

The returned [StateReference](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/statereference.md) is only meaningful for this [Context](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md) and references the state by its ID rather than by direct lookup. The state doesn't need to exist in the current state machine canvas at the time of this call. Throws ObjectDisposedException when you access this property after you call [Context.Dispose](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphvisualization/context/dispose.md) on the context. Throws ArgumentException when you provide an invalid `stateID`.

### Examples

```csharp
StateReference stateRef = context.GetStateReference(stateID);
stateRef.FillAmount = 75f;
```
