示例#1
0
    // 添加一个对象
    public bool InsertObject(ref U3D_Render.EntityView ev, UnityEngine.Vector3 loc)
    {
        // 暂时移除一次 看是否有重复插入
        bool bResult = m_gridTree.removeObject(ref ev, ev.LastGridLoc);

        if (bResult)
        {
            Trace.LogWarning("repeate InsertObject, id=" + ev.ID);
        }

        UnityEngine.Vector3 newLoc = AdjustLoc(loc);

        // 第一次初始化上一次坐标值
        ev.LastGridLoc = newLoc;

        return(m_gridTree.insertObject(ref ev, newLoc));
    }