private void SetManualPath(ManualPath path) { if (path.path.count == 0) { StopInternal(); return; } _stop = false; _stopped = false; _currentDestination = null; _currentPath = path.path; _currentGrid = GridManager.instance.GetGrid(_currentPath.Peek().position); _endOfResolvedPath = _currentPath.Last().position; _endOfPath = _endOfResolvedPath; _lastPathRequestTime = Time.time; }
private void StopInternal() { lock (_syncLock) { _stopped = true; _wayPoints.Clear(); _pathboundWayPoints.Clear(); _currentPath = null; _pendingPathRequest = null; _currentDestination = null; _pendingResult = null; _manualPath = null; } }
/// <summary> /// Asks the object to move along the specified path. /// </summary> /// <param name="path">The path.</param> public void MoveAlong(ManualPath path) { Ensure.ArgumentNotNull(path, "path"); StopInternal(); _manualPath = path; SetManualPath(path); }