# SaveStateMachine(StateMachine)

> Saves the asset of the specified StateMachine to disk if it has unsaved changes.

## Definition

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

```csharp
public static void SaveStateMachine(StateMachine stateMachine)
```

### Parameters

**** (\[StateMachine]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine)): The state machine to save.

### Remarks

This is the [StateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine.md) counterpart of [GraphDatabase.SaveGraph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/savegraph.md).
