public void FilterRequest(PathRequest nextRequest) { _pathIndex = 0; _isProcessingRequest = true; if (_currentMovementRoutine != null) { _currentRequest?.PathCompleteCallback?.Invoke(false); _monoBehaviour.StopCoroutine(_currentMovementRoutine); } _currentRequest = nextRequest; var generatedPath = _currentRequest.GeneratePath(); _path = generatedPath; var generatedDestination = _currentRequest.GenerateDestination(); if (generatedPath != null) { _currentMovementRoutine = _currentRequest.WayPoint != null ? _monoBehaviour.StartCoroutine(WayPointPath(_currentRequest, generatedPath)) : _monoBehaviour.StartCoroutine(NoWayPointPath(_currentRequest, generatedPath)); } else { _currentMovementRoutine = _monoBehaviour.StartCoroutine(NoPathNoWayPoint(_currentRequest, generatedDestination)); } _isProcessingRequest = false; }