Version: Unity 6.4 Alpha (6000.4)
LanguageEnglish
  • C#

GraphDatabase

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, graph assets.

The GraphDatabase class is similar to Unity's UnityEditor.AssetDatabase, but it is tailored for graph-based tools. Use this class to create, load, and save Graph instances and their associated assets. This API supports typical asset workflows such as creating new graph assets in the Project window, accessing graphs by path or GUID, and ensuring changes to graph data are saved. Use PromptInProjectBrowserToCreateNewAsset_1 to create and name a new asset, CreateGraph_1 to generate an asset file, and LoadGraph_1 to retrieve an existing one. Use SaveGraph to persist graph data changes, and LoadGraphForImporter_1 to load a clean instance during import.

Static Methods

Method Description
CreateGraph Creates a new graph asset of type T at the specified file path.
GetGraphAssetGUID Retrieves the globally unique identifier (GUID) for the asset associated with the specified Graph.
GetGraphAssetPath Retrieves the file path of the asset associated with the specified Graph.
LoadGraph Loads a Graph of type T from the asset at the specified path.
LoadGraphForImporter Loads a fresh instance of the Graph of type T from disk for use in the asset import pipeline.
PromptInProjectBrowserToCreateNewAsset Creates a new graph asset and activates the naming field in the Project Browser.
SaveGraph Saves the asset of the specified Graph to disk if it has unsaved changes.