# IStateOption

> Interface for a state option.

## Definition

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

```csharp
public interface IStateOption
```

## Remarks

State options are typed properties that appear in the graph inspector when a state is selected. They allow the tool developers to change the behavior of the state at edit time. Unlike the options of a [Node](/engine/6000.7/script-reference/unity/graphtoolkit/editor/node.md), they are never drawn on the state in the state machine canvas.

Each option has a unique [IStateOption.Name](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/name.md) (which must be unique per state for identification), a [IStateOption.DisplayName](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/displayname.md) (for the UI), and a [IStateOption.DataType](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/datatype.md) that defines the type of its value. Use [IStateOption.TryGetValue](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/trygetvalue.md) to retrieve the option's value.

See also:

* [State.OnDefineOptions](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state/ondefineoptions.md) for how to declare the options of a state

* [IStateOptionBuilder](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoptionbuilder.md) for how to configure an option as it is declared

Unity implements this interface. Do not implement it in your own types.

## Properties

| Property                                                                                             | Description                                                            |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [DataType](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/datatype.md)       | The data type of the state option.                                     |
| [DisplayName](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/displayname.md) | The display name of the state option shown in the UI.                  |
| [Name](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/name.md)               | The unique identifier of the state option.                             |
| [Tooltip](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/tooltip.md)         | The text displayed when hovering over the state option's display name. |

## Methods

| Method                                                                                               | Description                                                               |
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [TryGetValue](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/trygetvalue.md) | Tries to retrieve the value of the state option using the specified type. |
| [TrySetValue](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istateoption/trysetvalue.md) | Sets a new value for the state option.                                    |
