예제 #1
0
    public void DebugViewUpdate()
    {
        if (m_CurrentDebugView != m_DebugView)
        {
            m_CurrentDebugView = m_DebugView;
            m_DbgRenderMesh.Clear();

            switch (m_CurrentDebugView)
            {
            case DebugView.PolyMesh:
                RcdtcsUnityUtils.ShowRecastNavmesh(m_DbgRenderMesh, m_System.m_pmesh, m_System.m_cfg);
                break;

            case DebugView.NavMesh:
                RcdtcsUnityUtils.ShowTilePolyDetails(m_DbgRenderMesh, m_System.m_navMesh, 0);
                break;

            case DebugView.DetailMesh:
                RcdtcsUnityUtils.ShowRecastDetailMesh(m_DbgRenderMesh, m_System.m_dmesh);
                break;

            case DebugView.None:
                m_DbgRenderMesh.Rebuild();
                break;

            case DebugView.ContourSet:
                RcdtcsUnityUtils.ShowContours(m_DbgRenderMesh, m_System.m_cset);
                break;

            case DebugView.RawContourSet:
                RcdtcsUnityUtils.ShowRawContours(m_DbgRenderMesh, m_System.m_cset);
                break;
            }
        }
    }
예제 #2
0
 private void RecomputePath()
 {
     if (m_EndPos != Vector3.zero && m_StartPos != Vector3.zero)
     {
         m_DbgPathRenderer.Clear();
         m_ComputedPathType = m_PathType;
         if (m_PathType == PathType.Smooth)
         {
             m_SmoothPath = RcdtcsUnityUtils.ComputeSmoothPath(m_System.m_navQuery, m_StartPos, m_EndPos);
             m_DbgPathRenderer.AddPath(m_SmoothPath.m_smoothPath, m_SmoothPath.m_nsmoothPath, 1.25f, Color.black, Color.white);
         }
         else if (m_PathType == PathType.Straight)
         {
             m_StraightPath = RcdtcsUnityUtils.ComputeStraightPath(m_System.m_navQuery, m_StartPos, m_EndPos);
             m_DbgPathRenderer.AddPath(m_StraightPath.m_straightPath, m_StraightPath.m_straightPathCount, 1.25f, Color.black, Color.white);
         }
         m_DbgPathRenderer.Rebuild();
     }
 }
예제 #3
0
 public float[] GetClosestPointOnNavMesh(float[] pos)
 {
     return(RcdtcsUnityUtils.GetClosestPointOnNavMesh(m_navQuery, pos));
 }