Пример #1
0
 private bool Follow(NavmeshPoint pt)
 {
     if (!IsInited || !NavMeshMap.IsVaild)
     {
         return(false);
     }
     return(m_Agent.RequestMoveTarget(pt));
 }
Пример #2
0
    private NavStatus generateNavPath(NavmeshPoint start, NavmeshPoint end)
    {
        if (mCrowdAgent == null)
        {
            mCrowdAgent = mCrowdManager.AddAgent(start.point, mCrowdAgentParams);
            mCrowdAgent.RequestMoveTarget(end);
        }
        else
        {
            if (mCrowdAgent.Position != end.point)
            {
                mCrowdManager.RemoveAgent(mCrowdAgent);
                mCrowdAgent = mCrowdManager.AddAgent(start.point, mCrowdAgentParams);
                mCrowdAgent.RequestMoveTarget(end);
            }
        }

        //return status;
        return(NavStatus.Sucess);
    }