Example #1
0
    // 移动对象
    public bool MoveObject(ref U3D_Render.EntityView ev, UnityEngine.Vector3 newloc)
    {
        UnityEngine.Vector3 normalLoc = AdjustLoc(newloc);

        bool bResult = m_gridTree.moveObject(ref ev, ev.LastGridLoc, normalLoc);

        if (!bResult)
        {
            if (ev.StateMachine.m_OnViewVisible || ev.LastGridLoc != UnityEngine.Vector3.zero)
            {
                Trace.LogError("MoveObject failed, id=" + ev.ID);
            }

            return(bResult);
        }

        // 更新上一次坐标值
        ev.LastGridLoc = normalLoc;

        return(bResult);
    }