private QuadNode InsertObjectToNode(QuadNode node, IQuadObject quadObject)
        {
            if (!node.Bounds.Contains(quadObject.Bounds))
            {
                CoreLogger.Error(LOG_TAG, "QuadTree::InsertObjectToNode->Object's bounds is not fit within node bounds");
                return(null);
            }

            if (node.IsLeaf && node.Depth < m_MaxDepth && node.ObjectCount >= m_NodeSplitThreshold)
            {
                SplitNode(node);
                ResetNodeObjects(node);
            }

            if (!node.IsLeaf)
            {
                QuadNode[] childNodes = node.ChildNodes;
                foreach (var childNode in childNodes)
                {
                    if (childNode.Bounds.Contains(quadObject.Bounds))
                    {
                        return(InsertObjectToNode(childNode, quadObject));
                    }
                }
            }

            node.InsertObject(quadObject);
            m_ObjectToNodeDic[quadObject] = node;

            return(node);
        }
        //结点分裂后重新整理原来的对象
        private void ResetNodeObjects(QuadNode node)
        {
            List <IQuadObject> nodeObjects = QuadPool.GetObjectList();

            node.GetObjects(ref nodeObjects);

            node.ClearObjects();

            List <IQuadObject> uninsertToChildObjects = QuadPool.GetObjectList();

            foreach (var obj in nodeObjects)
            {
                bool isInsertToChildNode = false;

                QuadNode[] childNodes = node.ChildNodes;
                foreach (var childNode in childNodes)
                {
                    if (childNode.TryInsertObject(obj))
                    {
                        m_ObjectToNodeDic[obj] = childNode;
                        isInsertToChildNode    = true;
                        break;
                    }
                }

                if (!isInsertToChildNode)
                {
                    uninsertToChildObjects.Add(obj);
                }
            }

            if (uninsertToChildObjects.Count > 0)
            {
                foreach (var obj in uninsertToChildObjects)
                {
                    node.InsertObject(obj);
                }
            }
            QuadPool.ReleaseObjectList(nodeObjects);
            QuadPool.ReleaseObjectList(uninsertToChildObjects);
        }