GraphAttribute
Attribute used to declare a graph type by associating it with a file extension and optional configuration options.
Read time 4 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Class)]public class GraphAttribute : Attribute
Remarks
Use this attribute to associate a custom Graph class with a unique file extension and GraphOptions. The parameter defines the file extension for the graph assets. This extension must be unique across the project because Unity uses it to select the correct importer. You can also configure additional options using GraphOptions. This attribute is required for any class that inherits from Graph and serves as the entry point for enabling editor support for the graph tool.
extensionThis example keeps the default behavior and adds support for subgraphs by enabling GraphOptions.SupportsSubgraphs.
Examples
[Graph("mygraph", GraphOptions.SupportsSubgraphs)]public class MyGraph : Graph { }
Constructors
Constructor | Description |
|---|---|
| GraphAttribute(System.String,Unity.GraphToolkit.Editor.GraphOptions) | Initializes a new instance of the GraphAttribute class with a file extension and optional graph options. |
Properties
Property | Description |
|---|---|
| Extension | Gets the file extension associated with the Graph. |
| Options | Gets the graph configuration options. |