NodeUI CreateNewNode( INodeType type, Vector2 position )
NodeUI CreateNewNode( INodeType type, System.Action<INode> onCreated )
void CreateNewNode( INodeType type, Vector2 position, Plug targetPlug, bool selected )

book_4_sparkGenerated
code_blocksInput

Description

The CreateNewNode method is responsible for creating a new node within the graph view. This method takes in a node type and a position, and returns a NodeUI object representing the newly created node.

Usage

To use the CreateNewNode method, you need to provide the type of node you want to create and the position where the node should be placed within the graph view. The method will return a NodeUI object that you can use to further manipulate the node if needed.

Example

// Example of creating a new node in a graph view

// Assume 'graphView' is an instance of GraphView
Editor.NodeEditor.INodeType nodeType = ...; // Define or obtain the node type
Vector2 position = new Vector2(100, 200); // Define the position for the new node

Editor.NodeEditor.NodeUI newNode = graphView.CreateNewNode(nodeType, position);

// Now 'newNode' can be used to interact with the newly created node