From 1dab0f2b191d4e9c00521795ec6c0d863ef96cb3 Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 18 Nov 2022 16:45:56 +0800 Subject: [PATCH] Update patch system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 下载器增加取消方法。 --- .../PatchSystem/Operations/DownloaderOperation.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Assets/YooAsset/Runtime/PatchSystem/Operations/DownloaderOperation.cs b/Assets/YooAsset/Runtime/PatchSystem/Operations/DownloaderOperation.cs index 0f4d772..feb1e86 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/Operations/DownloaderOperation.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/Operations/DownloaderOperation.cs @@ -226,6 +226,19 @@ namespace YooAsset { _isPause = false; } + + /// + /// 取消下载 + /// + public void CancelDownload() + { + if (_steps != ESteps.Done) + { + _steps = ESteps.Done; + Status = EOperationStatus.Failed; + Error = "User cancel."; + } + } } public sealed class PackageDownloaderOperation : DownloaderOperation