private void TryProcessingNextPath() { if (!isProcessing && requests.Count > 0) { isProcessing = true; currentPathProcess = requests.Dequeue(); StartCoroutine(aStar.PathFindCo(currentPathProcess.start, currentPathProcess.end, currentPathProcess.id)); } }
public void RequestPath(PathRequest pathRequest) { requests.Enqueue(pathRequest); TryProcessingNextPath(); }