# OnDefineOptions(IOptionDefinitionContext)

> Called during State.DefineState to define the options available on the state.

## Definition

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

```csharp
protected virtual void OnDefineOptions(State.IOptionDefinitionContext context)
```

### Parameters

**** (\[IOptionDefinitionContext]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/state/ioptiondefinitioncontext)): Provides methods for defining state options.

### Remarks

Override this method to add options using the provided [State.IOptionDefinitionContext](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state/ioptiondefinitioncontext.md). The options of a state only appear in the graph inspector when the state is selected: they are never drawn on the state in the state machine view.

### Examples

```csharp
protected override void OnDefineOptions(IOptionDefinitionContext context)
{
    context.AddOption<float>("speed")
        .WithDisplayName("Speed")
        .WithTooltip("The speed at which the state runs.")
        .WithDefaultValue(1.0f);
}
```
