public virtual void Add(N newNode) { if (!allNodes.Contains(newNode)) { newNode.Owner = this as G; allNodes.Add(newNode); OnNodeAdd?.Invoke(newNode); if (StartOrRootNode == null) { StartOrRootNode = newNode; } } else { Debug.LogError("[HierarchicalGraph:Add()] -> Already contains this node."); } }
protected void invokeOnNodeAddEvent(N node) { OnNodeAdd?.Invoke(node); }