diff --git a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityAssetBundleRequestOperation.cs b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityAssetBundleRequestOperation.cs index 25d98ebe..621f2702 100644 --- a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityAssetBundleRequestOperation.cs +++ b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityAssetBundleRequestOperation.cs @@ -82,11 +82,6 @@ namespace YooAsset DisposeRequest(); } } - internal override void InternalAbort() - { - _steps = ESteps.Done; - DisposeRequest(); - } private void CreateWebRequest() { diff --git a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebDataRequestOperation.cs b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebDataRequestOperation.cs index d7635b5e..d0ad4b69 100644 --- a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebDataRequestOperation.cs +++ b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebDataRequestOperation.cs @@ -80,11 +80,6 @@ namespace YooAsset DisposeRequest(); } } - internal override void InternalAbort() - { - _steps = ESteps.Done; - DisposeRequest(); - } /// /// 不检测超时 diff --git a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebFileRequestOperation.cs b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebFileRequestOperation.cs index d81d2c7b..acc90fbe 100644 --- a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebFileRequestOperation.cs +++ b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebFileRequestOperation.cs @@ -64,11 +64,6 @@ namespace YooAsset DisposeRequest(); } } - internal override void InternalAbort() - { - _steps = ESteps.Done; - DisposeRequest(); - } private void CreateWebRequest() { diff --git a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebRequestOperation.cs b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebRequestOperation.cs index 4db73f98..a1c03e6b 100644 --- a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebRequestOperation.cs +++ b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebRequestOperation.cs @@ -43,6 +43,20 @@ namespace YooAsset _requestURL = url; _timeout = timeout; } + internal override void InternalAbort() + { + //TODO + // 1. 编辑器下停止运行游戏的时候主动终止下载任务 + // 2. 真机上销毁包裹的时候主动终止下载任务 + if (_isAbort == false) + { + if (_webRequest != null) + { + _webRequest.Abort(); + _isAbort = true; + } + } + } /// /// 释放下载器 diff --git a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebTextRequestOperation.cs b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebTextRequestOperation.cs index 8395d10a..a57a3f92 100644 --- a/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebTextRequestOperation.cs +++ b/Assets/YooAsset/Runtime/DownloadSystem/Operation/Internal/UnityWebTextRequestOperation.cs @@ -78,11 +78,6 @@ namespace YooAsset DisposeRequest(); } } - internal override void InternalAbort() - { - _steps = ESteps.Done; - DisposeRequest(); - } private void CreateWebRequest() {