コード例 #1
0
	private void OnPathRequestSucceeded(IPathRequestQuery request)
	{
		Vector3[] roughPath = request.GetSolutionPath(m_pathAgent.PathManager.PathTerrain);
		Vector3[] steeringPath = roughPath;
		
		if ( m_usePathSmoothing )
		{
			// Smooth the path
			Vector3[] aLeftPortalEndPts;
			Vector3[] aRightPortalEndPts;
			m_pathAgent.PathManager.PathTerrain.ComputePortalsForPathSmoothing( roughPath, out aLeftPortalEndPts, out aRightPortalEndPts );
			steeringPath = PathSmoother.Smooth(roughPath, request.GetStartPos(), request.GetGoalPos(), aLeftPortalEndPts, aRightPortalEndPts);
		}
		
		// Begin steering along this path
		m_steeringAgent.SteerAlongPath( steeringPath, m_pathAgent.PathManager.PathTerrain );
	}
    private void OnPathRequestSucceeded(IPathRequestQuery request)
    {
        Vector3[] roughPath    = request.GetSolutionPath(m_pathAgent.PathManager.PathTerrain);
        Vector3[] steeringPath = roughPath;

        if (m_usePathSmoothing)
        {
            // Smooth the path
            Vector3[] aLeftPortalEndPts;
            Vector3[] aRightPortalEndPts;
            m_pathAgent.PathManager.PathTerrain.ComputePortalsForPathSmoothing(roughPath, out aLeftPortalEndPts, out aRightPortalEndPts);
            steeringPath = PathSmoother.Smooth(roughPath, request.GetStartPos(), request.GetGoalPos(), aLeftPortalEndPts, aRightPortalEndPts);
        }

        // Begin steering along this path
        m_steeringAgent.SteerAlongPath(steeringPath, m_pathAgent.PathManager.PathTerrain);
    }
コード例 #3
0
 private void OnPathRequestSucceeded(IPathRequestQuery request)
 {
     Vector3[] roughPath = request.GetSolutionPath(m_pathAgent.PathManager.PathTerrain);
     m_steeringAgent.SteerAlongPath(roughPath, PathTerrain);
 }