GraphAttribute(string, GraphOptions)
Initializes a new instance of the GraphAttribute class with a file extension and optional graph options.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Constructor
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
public GraphAttribute(string extension, GraphOptions options = GraphOptions.Default)
Parameters
The file extension to associate with assets of the graph type. This value must be unique because Unity uses it to select the correct importer.
The configuration options for the graph. Defaults to GraphOptions.Default if not specified.
Remarks
Use this constructor to define the asset extension and configure the graph. This allows for proper asset recognition and import handling by Unity. The values in GraphOptions support bitwise combination. Combine multiple flags to configure the graph with custom behavior.
This example keeps the default behavior and adds support for subgraphs by enabling GraphOptions.SupportsSubgraphs.
Examples
[Graph("mygraph", GraphOptions.SupportsSubgraphs)]public class MyGraph : Graph { }