From 2c9819762a9ec03a44a2285598a80c3a9d9be64e Mon Sep 17 00:00:00 2001 From: hevinci Date: Sun, 1 May 2022 20:43:00 +0800 Subject: [PATCH] Update package update method --- .../Operations/UpdatePackageOperation.cs | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Assets/YooAsset/Runtime/PatchSystem/Operations/UpdatePackageOperation.cs b/Assets/YooAsset/Runtime/PatchSystem/Operations/UpdatePackageOperation.cs index 8204565..b69fa57 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/Operations/UpdatePackageOperation.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/Operations/UpdatePackageOperation.cs @@ -8,11 +8,11 @@ namespace YooAsset public abstract class UpdatePackageOperation : AsyncOperationBase { /// - /// 开始下载 + /// 创建包裹下载器 /// /// 同时下载的最大文件数 /// 下载失败的重试次数 - public abstract PackageDownloaderOperation BeginDownloadPackage(int downloadingMaxNumber, int failedTryAgain); + public abstract PackageDownloaderOperation CreatePackageDownloader(int downloadingMaxNumber, int failedTryAgain); } /// @@ -29,13 +29,12 @@ namespace YooAsset } /// - /// 开始下载 + /// 创建包裹下载器 /// - public override PackageDownloaderOperation BeginDownloadPackage(int downloadingMaxNumber, int failedTryAgain) + public override PackageDownloaderOperation CreatePackageDownloader(int downloadingMaxNumber, int failedTryAgain) { List downloadList = new List(); var operation = new PackageDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain); - operation.BeginDownload(); return operation; } } @@ -54,13 +53,12 @@ namespace YooAsset } /// - /// 开始下载 + /// 创建包裹下载器 /// - public override PackageDownloaderOperation BeginDownloadPackage(int downloadingMaxNumber, int failedTryAgain) + public override PackageDownloaderOperation CreatePackageDownloader(int downloadingMaxNumber, int failedTryAgain) { List downloadList = new List(); var operation = new PackageDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain); - operation.BeginDownload(); return operation; } } @@ -143,22 +141,20 @@ namespace YooAsset } /// - /// 开始下载 + /// 创建包裹下载器 /// - public override PackageDownloaderOperation BeginDownloadPackage(int downloadingMaxNumber, int failedTryAgain) + public override PackageDownloaderOperation CreatePackageDownloader(int downloadingMaxNumber, int failedTryAgain) { if (Status == EOperationStatus.Succeed) { List downloadList = GetDownloadList(); var operation = new PackageDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain); - operation.BeginDownload(); return operation; } else { YooLogger.Error($"{nameof(UpdatePackageOperation)} status is failed !"); var operation = new PackageDownloaderOperation(null, downloadingMaxNumber, failedTryAgain); - operation.BeginDownload(); return operation; } }