Beispiel #1
0
    void RemoveLeafFromChildren(QuadtreeBasicLeaf <T> leaf)
    {
        Debug.Log("位置在(" + _field.top + "," + _field.right + "," + _field.bottom + "," + _field.left + ")的树枝节点从子节点移除位置在" + leaf.position + "的叶子");

        if (_upperRightChild._field.Contains(leaf.position))
        {
            _upperRightChild.RemoveLeaf(leaf);
        }
        if (_lowerRightChild._field.Contains(leaf.position))
        {
            _lowerRightChild.RemoveLeaf(leaf);
        }
        if (_lowerLeftChild._field.Contains(leaf.position))
        {
            _lowerLeftChild.RemoveLeaf(leaf);
        }
        if (_upperLeftChild._field.Contains(leaf.position))
        {
            _upperLeftChild.RemoveLeaf(leaf);
        }
    }
Beispiel #2
0
 public static void RemoveLeaf(QuadtreeBasicLeaf <GameObject> leaf)
 {
     _quadtree.RemoveLeaf(leaf);
 }