public static void requestRoute(Vector3 routeStart, Vector3 routeEnd, Action <Vector3[], bool> recall) { RouteReqeust newRequest = new RouteReqeust(routeStart, routeEnd, recall); now.routeRequest.Enqueue(newRequest); now.TryProcessNext(); }
void TryProcessNext() { if (!routeProcessing && routeRequest.Count > 0) { currentRouteRequest = routeRequest.Dequeue(); routeProcessing = true; route.startFind(currentRouteRequest.routeStart, currentRouteRequest.routeEnd); } }