Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


StateMachineDatabase

Provides functionality needed to access, and perform operations on, state machine assets.
Read time 1 minuteLast updated 20 days ago

Definition

public static class StateMachineDatabase

Remarks

The
StateMachineDatabase
class is the StateMachine counterpart of GraphDatabase. Use this class to create, load, and save StateMachine instances and their associated assets.
Use StateMachineDatabase.PromptInProjectBrowserToCreateNewAsset to create and name a new asset, StateMachineDatabase.CreateStateMachine to generate an asset file, and StateMachineDatabase.LoadStateMachine to retrieve an existing one.
Use StateMachineDatabase.SaveStateMachine to persist state machine data changes, and StateMachineDatabase.LoadStateMachineForImporter to load a clean instance during import.

Static Methods

Method

Description

CreateStateMachineCreates a new state machine asset of type
T
at the specified file path.
GetStateMachineAssetGUIDRetrieves the globally unique identifier (GUID) for the asset associated with the specified StateMachine.
GetStateMachineAssetPathRetrieves the file path of the asset associated with the specified StateMachine.
LoadStateMachineLoads a StateMachine of type
T
from the asset at the specified path.
LoadStateMachineForImporterLoads a fresh instance of the StateMachine of type
T
from disk for use in the asset import pipeline.
PromptInProjectBrowserToCreateNewAssetCreates a new state machine asset and activates the naming field in the Project Browser.
SaveStateMachineSaves the asset of the specified StateMachine to disk if it has unsaved changes.