Update download system

使用新的断点续传下载器
This commit is contained in:
hevinci
2022-08-23 15:27:20 +08:00
parent 16f8592497
commit b5c82438a0
3 changed files with 53 additions and 24 deletions
@@ -86,11 +86,8 @@ namespace YooAsset
{
YooLogger.Log($"Beginning to download file : {bundleInfo.Bundle.FileName} URL : {bundleInfo.RemoteMainURL}");
FileUtility.CreateFileDirectory(bundleInfo.Bundle.CachedFilePath);
DownloaderBase newDownloader;
if (bundleInfo.Bundle.FileSize >= _breakpointResumeFileSize)
newDownloader = new HttpDownloader(bundleInfo);
else
newDownloader = new FileDownloader(bundleInfo);
bool breakDownload = bundleInfo.Bundle.FileSize >= _breakpointResumeFileSize;
DownloaderBase newDownloader = new FileDownloader(bundleInfo, breakDownload);
newDownloader.SendRequest(failedTryAgain, timeout);
_downloaderDic.Add(bundleInfo.Bundle.CachedFilePath, newDownloader);
return newDownloader;