public static void AsyncFileToDisk(string url, string floder, DiskFileCallback diskfilecallback, OnProgress progress, bool reloadFromServer = false) { Job job = new Job(url, floder, HttpMethod.FILETODISK, diskfilecallback, progress, 0, reloadFromServer); int queueIndex = UnityEngine.Random.Range(0, _singleton.Length - 1); _singleton[queueIndex].Enqueue(job); }
public Job(string url, string floder, HttpMethod httpMethod, DiskFileCallback diskfilecallback, OnProgress progress, int downloadRetries, bool reloadFromServer) { this.url = url; this.floder = floder; this.diskfilecallback = diskfilecallback; this.reloadFromServer = reloadFromServer; this.progress = progress; this.httpMethod = httpMethod; if (downloadRetries != default(int)) { this.downloadRetries = downloadRetries; } else { this.downloadRetries = 0; } }