# IState

> Interface for a state in a IState.StateMachine.

## Definition

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

```csharp
public interface IState
```

## Remarks

A state is the state machine equivalent of an [INode](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode.md). Unlike a node, a state does not expose configurable input and output ports: its incoming and outgoing connections are transitions managed by the state machine itself.

See also:

* [State](/engine/6000.7/script-reference/unity/graphtoolkit/editor/state.md) for the base class used to define custom states

* [ISubgraphState](/engine/6000.7/script-reference/unity/graphtoolkit/editor/isubgraphstate.md) for how to work with subgraph-based states

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

## Properties

| Property                                                                                         | Description                                                                                                                           |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| [DefaultColor](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/defaultcolor.md) | The highlight color of the state. The highlight is located on the upper border of the state.                                          |
| [FillAmount](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/fillamount.md)     | The progress fill amount displayed on the state's accent bar, expressed as a percentage.                                              |
| [ID](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/id.md)                     | The globally unique identifier for this state.                                                                                        |
| [IsConnected](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/isconnected.md)   | Whether the state is connected to at least one transition.                                                                            |
| [OptionCount](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/optioncount.md)   | The number of options defined in the state.                                                                                           |
| [Options](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/options.md)           | The options defined on this state.                                                                                                    |
| [Position](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/position.md)         | The position of the state in the state machine.                                                                                       |
| [StateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/statemachine.md) | The [IState.StateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/statemachine.md) that contains this state. |
| [Subtitle](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/subtitle.md)         | The secondary text displayed in the state's header.                                                                                   |
| [Title](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/title.md)               | The main text displayed in the state's header.                                                                                        |
| [Tooltip](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/tooltip.md)           | The text displayed when hovering over the state's header.                                                                             |

## Methods

| Method                                                                                                               | Description                                               |
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [GetIncomingTransitions](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/getincomingtransitions.md) | Retrieves the transitions that go to this state.          |
| [GetOption](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/getoption.md)                           | Retrieves a state option using its zero-based index.      |
| [GetOptionByName](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/getoptionbyname.md)               | Retrieves a state option using its name.                  |
| [GetOutgoingTransitions](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/getoutgoingtransitions.md) | Retrieves the transitions that originate from this state. |
| [RemoveFromStateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate/removefromstatemachine.md) | Removes the state from its state machine.                 |
