# StateMachineAttribute(string, StateMachineOptions)

> Initializes a new instance of the StateMachineAttribute class with a file extension and optional state machine options.

## Definition

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

```csharp
public StateMachineAttribute(string extension, StateMachineOptions options = StateMachineOptions.Default)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file extension to associate with assets of the state machine type. This value must be unique because Unity uses it to select the correct importer.**** (\[StateMachineOptions]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachineoptions)): The configuration options for the state machine. Defaults to [StateMachineOptions.Default](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachineoptions/default.md) if not specified.

### Remarks

Use this constructor to define the asset extension and configure the state machine. This allows for proper asset recognition and import handling by Unity. The values in [StateMachineOptions](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachineoptions.md) support bitwise combination. Combine multiple flags to configure the state machine with custom behavior.

### Examples

```csharp
[StateMachine("mystatemachine", StateMachineOptions.DisableAutoInclusionOfStatesFromStateMachineAssembly)]
public class MyStateMachine : StateMachine { }
```
