Ejemplo n.º 1
0
    public bool MoveToPosition(Vector3 targetPosition, float replanInterval)
    {
        NavTargetPos   navTargetPos = new NavTargetPos(targetPosition, PathTerrain);
        PathPlanParams planParams   = new PathPlanParams(transform.position, navTargetPos, replanInterval);

        return(m_pathAgent.RequestPath(planParams));
    }
Ejemplo n.º 2
0
    //add by bobo
    public bool ChangeTargetPos(Vector3 targetPos)
    {
        NavTargetPos navTargetPos = new NavTargetPos(targetPos, PathTerrain);

        if (m_planParams != null)
        {
            m_planParams.SetTarget(navTargetPos);
            return(true);
        }
        return(false);
    }