# GetRule(int)

> Retrieves the rule at the specified index.

## Definition

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

```csharp
ITransitionRule GetRule(int index)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The zero-based index of the rule to retrieve.

### Returns

| Type                                                                                            | Description                      |
| ----------------------------------------------------------------------------------------------- | -------------------------------- |
| [ITransitionRule](/engine/6000.7/script-reference/unity/graphtoolkit/editor/itransitionrule.md) | The rule at the specified index. |

### Remarks

Throws ArgumentOutOfRangeException when `index` is less than 0 or greater than or equal to [ITransition.RuleCount](/engine/6000.7/script-reference/unity/graphtoolkit/editor/itransition/rulecount.md).
