예제 #1
0
        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.");
            }
        }
예제 #2
0
 protected void invokeOnNodeAddEvent(N node)
 {
     OnNodeAdd?.Invoke(node);
 }