# DefineState()

> Defines the structure of the state by building its options.

## Definition

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

```csharp
public void DefineState()
```

### Remarks

This method calls [State.OnDefineOptions](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state/ondefineoptions.md) to allow custom definition of the state. It does nothing when the state is not part of a [State.StateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state/statemachine.md).

### Examples

```csharp
public class MyState : State
{
    public override void OnEnable()
    {
        DefineState();
    }
}
```
