Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

StateMachineDatabase

class in Unity.GraphToolkit.Editor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Provides functionality needed to access, and perform operations on, state machine assets.

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
CreateStateMachine Creates a new state machine asset of type T at the specified file path.
GetStateMachineAssetGUID Retrieves the globally unique identifier (GUID) for the asset associated with the specified StateMachine.
GetStateMachineAssetPath Retrieves the file path of the asset associated with the specified StateMachine.
LoadStateMachine Loads a StateMachine of type T from the asset at the specified path.
LoadStateMachineForImporter Loads a fresh instance of the StateMachine of type T from disk for use in the asset import pipeline.
PromptInProjectBrowserToCreateNewAsset Creates a new state machine asset and activates the naming field in the Project Browser.
SaveStateMachine Saves the asset of the specified StateMachine to disk if it has unsaved changes.