IEnumerator GetFileRequest(List<String> urlList, Action<List<UnityWebRequest>> callback)
{
List<UnityWebRequest> reqList = new List<UnityWebRequest>();
for (int i = 0; i < urlList.Count; i++)
{
using (UnityWebRequest req = UnityWebRequest.Get(urlList[i]))
{
req.downloadHandler = new DownloadHandlerFile(GetFilePath(urlList[i]));
reqList.Add(req);
}
}
yield return reqList;
callback(reqList);
}
I'm using this code, all files get downloaded, but they seem to be corrupted ( I guess it's not completely downloaded). How do I complete the download without files getting corrupted?