示例#1
0
文件: Navigator.cs 项目: Joelone/Path
        internal void OnPathFailed(Seeker seeker)
        {
            if (seeker == m_ActiveMainSeeker)
            {
                SendMessage ("OnTargetUnreachable", SendMessageOptions.DontRequireReceiver);
                m_ActiveMainSeeker = null;
                return;
            }

            SendMessage ("OnPathUnavailable", SendMessageOptions.DontRequireReceiver);
        }
示例#2
0
文件: Navigator.cs 项目: Joelone/Path
        internal void OnPathResult(Seeker seeker, Path result)
        {
            if (seeker == m_ActiveMainSeeker)
            {
                SendMessage ("OnNewPath", result, SendMessageOptions.DontRequireReceiver);
                m_ActiveMainSeeker = null;
                return;
            }

            SendMessage ("OnPathAvailable", result, SendMessageOptions.DontRequireReceiver);
        }
示例#3
0
文件: Navigator.cs 项目: Joelone/Path
 /// Force pathfinding to targetPosition. This is useful if the current path to targetPosition has for some reason
 /// been invalidated. Calling ReSeek will recalculate it, even though targetPosition has not changed.
 public void ReSeek()
 {
     if (m_ActiveMainSeeker != null)
     {
         m_ActiveMainSeeker.Stop ();
     }
     m_ActiveMainSeeker = new Seeker (transform.position, targetPosition, this);
     StartCoroutine (m_ActiveMainSeeker.Seek ());
     m_PathfoundTargetPosition = targetPosition;
 }