public void Delete(GameObject go) { QuadTreeNode currentNode = (QuadTreeNode)FindNode(go); currentNode.RemoveForm(go.GetComponent <AABB>()); currentNode.BackPropagate(); }
public void BackPropagate() { if (this.IsLeaf() && parent != null) { parent.BackPropagate(); } else if (parent != null) { foreach (var child in subNodes) { if (child.HasSomething()) { return; } } subNodes = null; parent.BackPropagate(); } }