예제 #1
0
        internal void RemoveAgent(CrowdMoveAgent agent)
        {
            if (m_IsAppQuit || agent == null)
            {
                return;
            }

            if (agent == null)
            {
                return;
            }

            if (agent.HasListNode)
            {
                var node = agent.ListNode;
                m_AgentList.Remove(node);
            }

            if (m_Mgr != null)
            {
                m_Mgr.RemoveAgent(agent.Agent);
            }
        }
예제 #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);
    }