CreateConstantNode
Creates and adds a new constant node to the graph.
阅读时间1 分钟最后更新于 1 个月前
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.