Update DownloadSystem

This commit is contained in:
hevinci
2022-03-29 19:45:20 +08:00
parent 32d422aeaa
commit 2d9cccae6f
5 changed files with 33 additions and 36 deletions
@@ -41,7 +41,7 @@ namespace YooAsset
private readonly List<ProviderBase> _providers = new List<ProviderBase>(100);
private bool _isWaitForAsyncComplete = false;
private bool _isShowWaitForAsyncError = false;
private FileDownloader _fileDownloader;
private DownloaderBase _downloader;
private AssetBundleCreateRequest _cacheRequest;
internal AssetBundle CacheBundle { private set; get; }
@@ -106,19 +106,19 @@ namespace YooAsset
if (Status == EStatus.Download)
{
int failedTryAgain = int.MaxValue;
_fileDownloader = DownloadSystem.BeginDownload(BundleFileInfo, failedTryAgain);
_downloader = DownloadSystem.BeginDownload(BundleFileInfo, failedTryAgain);
Status = EStatus.CheckDownload;
}
// 2. 检测服务器下载结果
if (Status == EStatus.CheckDownload)
{
if (_fileDownloader.IsDone() == false)
if (_downloader.IsDone() == false)
return;
if (_fileDownloader.HasError())
if (_downloader.HasError())
{
_fileDownloader.ReportError();
_downloader.ReportError();
Status = EStatus.Fail;
}
else