Esempio n. 1
0
        public void _add_node(List <string> nodes, ETreeNodeData data)
        {
            if (nodes.Count == 0)
            {
                Debug.LogError("_add_node" + data.NodeName);
                return;
            }
            else if (nodes.Count == 1)
            {
                if (HasNode(nodes[0]))
                {
                    Debug.LogError("已经存在了这样的节点:" + data.NodeName);
                    return;
                }
                EAbTreeNode new_node = new EAbTreeNode(data);
                _insert_node(new_node);
                return;
            }
            else
            {
                string find_node = nodes[0];
                nodes.RemoveAt(0);

                EAbTreeNode ab_tree_node = _find_node(find_node);
                ab_tree_node._add_node(nodes, data);
            }
        }
Esempio n. 2
0
 public EAbTreeNode(ETreeNodeData data)
 {
     _data       = data;
     _node_depth = 0;
     if (_data.NodeType == E_AbTreeNodeType.tree_leaf)
     {
         _draw = new ETreeNodeDataDraw(_data.info);
     }
 }
Esempio n. 3
0
        public void _add_nodes(ETreeNodeData data)
        {
            List <string> segments = new List <string>(data.NodeName.Split('/'));

            if (segments.Count == 0)
            {
                Debug.LogError("路径不符合要求," + data.NodeName);
                return;
            }
            string find_node = segments[0];

            segments.RemoveAt(0);

            if (find_node != _data.draw_name)
            {
                Debug.LogError("跟目录不符合要求" + data.NodeName);
            }
            _add_node(segments, data);
        }