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