Пример #1
0
        public static void AddAsFloatingNode(this TreeHierarchyAsset tree, TreeNodeAsset newNode)
        {
            Debug.Assert(newNode._hierarchy == null, nodeInHierarchyMsg);

            var hierarchyNode = CreateHierarchyNodeAndLink(tree, newNode);

            hierarchyNode._tree = tree;
            tree._floaters.Add(hierarchyNode);
        }
Пример #2
0
        public static void SetupRoot(this TreeHierarchyAsset tree, TreeNodeAsset root)
        {
            Debug.Assert(tree._root == null);

            var rootHierarchyNode = CreateHierarchyNodeAndLink(tree, root);

            tree._root = rootHierarchyNode;
            rootHierarchyNode._tree = tree;
        }
Пример #3
0
        private static TreeHierarchyNodeAsset CreateHierarchyNodeAndLink(this TreeHierarchyAsset tree, TreeNodeAsset node)
        {
            Debug.Assert(node._hierarchy == null, nodeInHierarchyMsg);

            var hieNode = CreateHierarchyNodeAsset(tree);

            hieNode.name = string.Format("_Node ({0})", node.name);

            node._hierarchy  = hieNode;
            hieNode._content = node;

            return(hieNode);
        }