Пример #1
0
        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;
        }
Пример #2
0
 private void StopInternal()
 {
     lock (_syncLock)
     {
         _stopped = true;
         _wayPoints.Clear();
         _pathboundWayPoints.Clear();
         _currentPath = null;
         _pendingPathRequest = null;
         _currentDestination = null;
         _pendingResult = null;
         _manualPath = null;
     }
 }
Пример #3
0
        /// <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);
        }