Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CreateConstantNode

Creates and adds a new constant node to the graph.
Read time 1 minuteLast updated 6 days ago

Definition

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

position

The position of the node.

valueType

The type of the value held by the constant.

defaultValue

The default value.

Returns

Type

Description

IConstantNodeThe 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

position

The position of the node.

defaultValue

T
The default value.

Returns

Type

Description

IConstantNodeThe 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.