diff --git a/Assets/YooAsset/Samples~/Mini Game/Runtime/TiktokFileSystem/Operation/TTFSDownloadFileOperation.cs b/Assets/YooAsset/Samples~/Mini Game/Runtime/TiktokFileSystem/Operation/TTFSDownloadFileOperation.cs index 9bd24597..f8520a0e 100644 --- a/Assets/YooAsset/Samples~/Mini Game/Runtime/TiktokFileSystem/Operation/TTFSDownloadFileOperation.cs +++ b/Assets/YooAsset/Samples~/Mini Game/Runtime/TiktokFileSystem/Operation/TTFSDownloadFileOperation.cs @@ -15,7 +15,7 @@ internal class TTFSDownloadFileOperation : FSDownloadFileOperation private readonly TiktokFileSystem _fileSystem; private readonly DownloadFileOptions _options; - private UnityWebCacheRequestOperation _unityWebCacheRequestOp; + private UnityWebCacheRequestOperation _webCacheRequestOp; private int _requestCount = 0; private float _tryAgainTimer; private int _failedTryAgain; @@ -36,21 +36,23 @@ internal class TTFSDownloadFileOperation : FSDownloadFileOperation if (_steps == ESteps.CreateRequest) { string url = GetRequestURL(); - _unityWebCacheRequestOp = new UnityWebCacheRequestOperation(url); - _unityWebCacheRequestOp.StartOperation(); + _webCacheRequestOp = new UnityWebCacheRequestOperation(url); + _webCacheRequestOp.StartOperation(); + AddChildOperation(_webCacheRequestOp); _steps = ESteps.CheckRequest; } // 检测下载结果 if (_steps == ESteps.CheckRequest) { - Progress = _unityWebCacheRequestOp.Progress; - DownloadProgress = _unityWebCacheRequestOp.DownloadProgress; - DownloadedBytes = (long)_unityWebCacheRequestOp.DownloadedBytes; - if (_unityWebCacheRequestOp.IsDone == false) + _webCacheRequestOp.UpdateOperation(); + Progress = _webCacheRequestOp.Progress; + DownloadProgress = _webCacheRequestOp.DownloadProgress; + DownloadedBytes = (long)_webCacheRequestOp.DownloadedBytes; + if (_webCacheRequestOp.IsDone == false) return; - if (_unityWebCacheRequestOp.Status == EOperationStatus.Succeed) + if (_webCacheRequestOp.Status == EOperationStatus.Succeed) { _steps = ESteps.Done; Status = EOperationStatus.Succeed; @@ -65,13 +67,13 @@ internal class TTFSDownloadFileOperation : FSDownloadFileOperation if (_failedTryAgain > 0) { _steps = ESteps.TryAgain; - YooLogger.Warning($"Failed download : {_unityWebCacheRequestOp.URL} Try again !"); + YooLogger.Warning($"Failed download : {_webCacheRequestOp.URL} Try again !"); } else { _steps = ESteps.Done; Status = EOperationStatus.Failed; - Error = _unityWebCacheRequestOp.Error; + Error = _webCacheRequestOp.Error; YooLogger.Error(Error); } } diff --git a/Assets/YooAsset/Samples~/Mini Game/Runtime/TiktokFileSystem/Operation/TTFSLoadBundleOperation.cs b/Assets/YooAsset/Samples~/Mini Game/Runtime/TiktokFileSystem/Operation/TTFSLoadBundleOperation.cs index 16d7b868..f0189642 100644 --- a/Assets/YooAsset/Samples~/Mini Game/Runtime/TiktokFileSystem/Operation/TTFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Samples~/Mini Game/Runtime/TiktokFileSystem/Operation/TTFSLoadBundleOperation.cs @@ -54,9 +54,9 @@ internal class TTFSLoadBundleOperation : FSLoadBundleOperation } _loadWebAssetBundleOp.UpdateOperation(); + Progress = _loadWebAssetBundleOp.Progress; DownloadProgress = _loadWebAssetBundleOp.DownloadProgress; DownloadedBytes = (long)_loadWebAssetBundleOp.DownloadedBytes; - Progress = DownloadProgress; if (_loadWebAssetBundleOp.IsDone == false) return; diff --git a/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/WXFSDownloadFileOperation.cs b/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/WXFSDownloadFileOperation.cs index 9827ad6d..9b10bd53 100644 --- a/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/WXFSDownloadFileOperation.cs +++ b/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/WXFSDownloadFileOperation.cs @@ -15,7 +15,7 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation private readonly WechatFileSystem _fileSystem; private readonly DownloadFileOptions _options; - private UnityWebCacheRequestOperation _unityWebCacheRequestOp; + private UnityWebCacheRequestOperation _webCacheRequestOp; private int _requestCount = 0; private float _tryAgainTimer; private int _failedTryAgain; @@ -36,24 +36,24 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation if (_steps == ESteps.CreateRequest) { string url = GetRequestURL(); - _unityWebCacheRequestOp = new UnityWebCacheRequestOperation(url); - _unityWebCacheRequestOp.SetRequestHeader("wechatminigame-preload", "1"); - _unityWebCacheRequestOp.StartOperation(); - AddChildOperation(_unityWebCacheRequestOp); + _webCacheRequestOp = new UnityWebCacheRequestOperation(url); + _webCacheRequestOp.SetRequestHeader("wechatminigame-preload", "1"); + _webCacheRequestOp.StartOperation(); + AddChildOperation(_webCacheRequestOp); _steps = ESteps.CheckRequest; } // 检测下载结果 if (_steps == ESteps.CheckRequest) { - _unityWebCacheRequestOp.UpdateOperation(); - Progress = _unityWebCacheRequestOp.Progress; - DownloadProgress = _unityWebCacheRequestOp.DownloadProgress; - DownloadedBytes = (long)_unityWebCacheRequestOp.DownloadedBytes; - if (_unityWebCacheRequestOp.IsDone == false) + _webCacheRequestOp.UpdateOperation(); + Progress = _webCacheRequestOp.Progress; + DownloadProgress = _webCacheRequestOp.DownloadProgress; + DownloadedBytes = (long)_webCacheRequestOp.DownloadedBytes; + if (_webCacheRequestOp.IsDone == false) return; - if (_unityWebCacheRequestOp.Status == EOperationStatus.Succeed) + if (_webCacheRequestOp.Status == EOperationStatus.Succeed) { _steps = ESteps.Done; Status = EOperationStatus.Succeed; @@ -69,13 +69,13 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation if (_failedTryAgain > 0) { _steps = ESteps.TryAgain; - YooLogger.Warning($"Failed download : {_unityWebCacheRequestOp.URL} Try again !"); + YooLogger.Warning($"Failed download : {_webCacheRequestOp.URL} Try again !"); } else { _steps = ESteps.Done; Status = EOperationStatus.Failed; - Error = _unityWebCacheRequestOp.Error; + Error = _webCacheRequestOp.Error; YooLogger.Error(Error); } } diff --git a/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs b/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs index f7e3a698..bf2918ed 100644 --- a/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs @@ -53,9 +53,9 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation } _loadWebAssetBundleOp.UpdateOperation(); + Progress = _loadWebAssetBundleOp.Progress; DownloadProgress = _loadWebAssetBundleOp.DownloadProgress; DownloadedBytes = (long)_loadWebAssetBundleOp.DownloadedBytes; - Progress = DownloadProgress; if (_loadWebAssetBundleOp.IsDone == false) return; diff --git a/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/internal/LoadWechatAssetBundleOperation.cs b/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/internal/LoadWechatAssetBundleOperation.cs index 496fb031..a32b18ee 100644 --- a/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/internal/LoadWechatAssetBundleOperation.cs +++ b/Assets/YooAsset/Samples~/Mini Game/Runtime/WechatFileSystem/Operation/internal/LoadWechatAssetBundleOperation.cs @@ -96,12 +96,6 @@ namespace YooAsset } } } - internal override void InternalAbort() - { - _steps = ESteps.Done; - if (_unityWechatAssetBundleRequestOp != null) - _unityWechatAssetBundleRequestOp.AbortOperation(); - } /// /// 获取网络请求地址