/// <summary> /// Create both a data instance as well as a visual instance of a fresh node. /// </summary> public NodeView CreateNode(Type nodeType, Vector2 pos) { Undo.RegisterCompleteObjectUndo(NodeGraph, "Created Node"); ANode node = m_nodeCollection.CreateNode(nodeType, pos); m_nodeListProp.serializedObject.Update(); NodeView nodeView = CreateNodeView(node); RefreshSerializedNodeReferences(); return(nodeView); }