private static void QueueRequest(FileData fileData)
        {
            UnityWebRequest req = new UnityWebRequest
            {
                url             = fileData.url,
                method          = UnityWebRequest.kHttpVerbGET,
                downloadHandler = new DownloadHandlerFile(fileData.savePath)
                {
                    removeFileOnAbort = true,
                },
            };

            WebRequestQueueOperation webRequestQueueOperation = WebRequestQueue.QueueRequest(req);

            if (webRequestQueueOperation.IsDone)
            {
                UnityWebRequestAsyncOperation requestOperation = webRequestQueueOperation.Result;
                requestOperation.completed += WebRequestOperationCompleted;
            }
            else
            {
                webRequestQueueOperation.OnComplete += asyncOP =>
                {
                    UnityWebRequestAsyncOperation requestOperation = asyncOP as UnityWebRequestAsyncOperation;
                    requestOperation.completed += WebRequestOperationCompleted;
                };
            }

            fileData.webRequestQueueOperation = webRequestQueueOperation;
        }
        public static WebRequestQueueOperation QueueRequest(UnityWebRequest request)
        {
            WebRequestQueueOperation queueOperation = new WebRequestQueueOperation(request);

            if (ActiveRequests.Count < MaxRequest)
            {
                UnityWebRequestAsyncOperation webRequestAsyncOp = request.SendWebRequest();
                webRequestAsyncOp.completed += OnWebAsyncOpComplete;
                ActiveRequests.Add(webRequestAsyncOp);
                queueOperation.Complete(webRequestAsyncOp);
            }
            else
            {
                QueuedOperations.Enqueue(queueOperation);
            }

            return(queueOperation);
        }
        private static void OnWebAsyncOpComplete(AsyncOperation operation)
        {
            ActiveRequests.Remove((operation as UnityWebRequestAsyncOperation));

            while (QueuedOperations.Count > 0)
            {
                WebRequestQueueOperation      nextQueuedOperation = QueuedOperations.Dequeue();
                UnityWebRequestAsyncOperation webRequestAsyncOp   = nextQueuedOperation.webRequest.SendWebRequest();
                if (webRequestAsyncOp == null)
                {
                    nextQueuedOperation.webRequest.Dispose();
                    nextQueuedOperation.webRequest = null;
                    continue;
                }
                webRequestAsyncOp.completed += OnWebAsyncOpComplete;
                ActiveRequests.Add(webRequestAsyncOp);
                nextQueuedOperation.Complete(webRequestAsyncOp);
                break;
            }
        }