internal void OnPathFailed(Seeker seeker) { if (seeker == m_ActiveMainSeeker) { SendMessage ("OnTargetUnreachable", SendMessageOptions.DontRequireReceiver); m_ActiveMainSeeker = null; return; } SendMessage ("OnPathUnavailable", SendMessageOptions.DontRequireReceiver); }
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); }
/// 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; }