protected void CancelCurrentPathRequest() { waitingForPathCalculation = false; // Abort calculation of the current path if (seeker != null) { seeker.CancelCurrentPathRequest(); } }
public void OnDisable() { if (seeker != null) { seeker.CancelCurrentPathRequest(); } canSearchAgain = true; if (path != null) { path.Release(this); } path = null; interpolator.SetPath(null); seeker.pathCallback -= OnPathComplete; }
/// <summary> /// Clears the current path of the agent. /// /// Usually invoked using <see cref="SetPath(null)"/> /// /// See: <see cref="SetPath"/> /// See: <see cref="isStopped"/> /// </summary> protected virtual void ClearPath() { // Abort any calculations in progress if (seeker != null) { seeker.CancelCurrentPathRequest(); } canSearchAgain = true; reachedEndOfPath = false; // Release current path so that it can be pooled if (path != null) { path.Release(this); } path = null; interpolator.SetPath(null); }
public void OnDisable() { // Abort any calculations in progress if (seeker != null) { seeker.CancelCurrentPathRequest(); } canSearchAgain = true; // Release current path so that it can be pooled if (path != null) { path.Release(this); } path = null; interpolator.SetPath(null); // Make sure we no longer receive callbacks when paths complete seeker.pathCallback -= OnPathComplete; }