CreateConstantNode
Creates and adds a new constant node to the graph.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
CreateConstantNode(Vector2, Type, Object)
Creates and adds a new constant node to the graph.
public IConstantNode CreateConstantNode(Vector2 position, Type valueType, object defaultValue = null)
Parameters
Returns
Type | Description |
|---|---|
| IConstantNode | The newly created constant node. |
Remarks
If successful, also adds the node's type to the graph's list of supported types. Enclose this method with Graph.UndoBeginRecordGraph and Graph.UndoEndRecordGraph to add this operation to the undo stack and to update the graph view with the changes.
CreateConstantNode<T>(Vector2, T)
Creates and adds a new constant node to the graph.
public IConstantNode CreateConstantNode<T>(Vector2 position, T defaultValue = default)
Parameters
Returns
Type | Description |
|---|---|
| IConstantNode | The newly created constant node. |
Remarks
If successful, also adds the node's type to the graph's list of supported types. Enclose this method with Graph.UndoBeginRecordGraph and Graph.UndoEndRecordGraph to add this operation to the undo stack and to update the graph view with the changes.