Ejemplo n.º 1
0
        private static TreeHierarchyNodeAsset CreateHierarchyNodeAsset(TreeHierarchyAsset hierarchy)
        {
            var hieNode = ScriptableObject.CreateInstance <TreeHierarchyNodeAsset>();

            AssetDatabase.AddObjectToAsset(hieNode, hierarchy);
            return(hieNode);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
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);
        }