# StateAttribute

> Initializes a new instance of the StateAttribute class.

## Definition

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

## StateAttribute(string)

Initializes a new instance of the [StateAttribute](/engine/6000.7/script-reference/unity/graphtoolkit/editor/stateattribute.md) class.

```csharp
public StateAttribute(string categoryPath)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The category path of the state in the graph item library.

## StateAttribute(string, string)

Initializes a new instance of the [StateAttribute](/engine/6000.7/script-reference/unity/graphtoolkit/editor/stateattribute.md) class.

```csharp
public StateAttribute(string categoryPath, string iconPath)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The category path of the state in the graph item library.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file path to the state's icon.

## StateAttribute(string, string, string)

Initializes a new instance of the [StateAttribute](/engine/6000.7/script-reference/unity/graphtoolkit/editor/stateattribute.md) class.

```csharp
public StateAttribute(string categoryPath, string iconPath, string title)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The category path of the state in the graph item library.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file path to the state's icon.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The title of the state in the graph item library. It is also used as the title of this state when it is instantiated in a graph.

## StateAttribute(string, string, string, string)

Initializes a new instance of the [StateAttribute](/engine/6000.7/script-reference/unity/graphtoolkit/editor/stateattribute.md) class.

```csharp
public StateAttribute(string categoryPath, string iconPath, string title, string stylesheet)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The category path of the state in the graph item library.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file path to the state's icon.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The title of the state in the graph item library. It is also used as the title of this state when it is instantiated in a graph.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path to a stylesheet (.uss) used to customize the state's [VisualElement](/engine/6000.7/script-reference/unityengine/uielements/visualelement.md) appearance.
