# IStateOptionBuilder<TData>

> Interface used to build and configure state options in a fluent manner.

## Definition

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

```csharp
public interface IStateOptionBuilder<in TData>
```

## Remarks

Provided by the [State.IOptionDefinitionContext](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state/ioptiondefinitioncontext.md) in a state's [State.OnDefineOptions](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state/ondefineoptions.md) method.

## Examples

```csharp
protected override void OnDefineOptions(IOptionDefinitionContext context)
{
    context.AddOption<int>("MyOption")
        .WithDefaultValue(2)
        .Delayed();
}
```

## Methods

| Method                                                                                                                 | Description                                                                                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AsTextArea](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoptionbuilder1/astextarea.md)             | Configures the option to use the [TextAreaAttribute](/engine/6000.7/script-reference/unityengine/textareaattribute.md).                                                            |
| [Build](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoptionbuilder1/build.md)                       | Builds and returns the final [IStateOption](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption.md) instance based on the current configuration of the builder. |
| [Delayed](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoptionbuilder1/delayed.md)                   | Configures the option to use the [DelayedAttribute](/engine/6000.7/script-reference/unityengine/delayedattribute.md).                                                              |
| [WithDefaultValue](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoptionbuilder1/withdefaultvalue.md) | Configures the default value for the option being built.                                                                                                                           |
| [WithDisplayName](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoptionbuilder1/withdisplayname.md)   | Configures the display name of the option being built.                                                                                                                             |
| [WithTooltip](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoptionbuilder1/withtooltip.md)           | Configures the tooltip text for the option being built.                                                                                                                            |
