示例#1
0
    public SceneSeparateTreeNode <T> Insert(T obj, int depth, int maxDepth)
    {
        if (m_ObjectList.Contains(obj))
        {
            return(this);
        }
        if (depth < maxDepth)
        {
            SceneSeparateTreeNode <T> node = GetContainerNode(obj, depth);
            if (node != null)
            {
                return(node.Insert(obj, depth + 1, maxDepth));
            }
        }
        var n = m_ObjectList.AddFirst(obj);

        obj.SetLinkedListNode(n);
        return(this);
    }
示例#2
0
 public void Add(T item)
 {
     m_Root.Insert(item, 0, m_MaxDepth);
 }