diff --git a/Assets/YooAsset/Runtime/DownloadSystem/DownloadParam.cs b/Assets/YooAsset/Runtime/DownloadSystem/DownloadParam.cs deleted file mode 100644 index 08efef4c..00000000 --- a/Assets/YooAsset/Runtime/DownloadSystem/DownloadParam.cs +++ /dev/null @@ -1,30 +0,0 @@ - -namespace YooAsset -{ - internal class DownloadParam - { - public readonly int FailedTryAgain; - public readonly int Timeout; - - /// <summary> - /// 导入的本地文件路径 - /// </summary> - public string ImportFilePath { set; get; } - - /// <summary> - /// 主资源地址 - /// </summary> - public string MainURL { set; get; } - - /// <summary> - /// 备用资源地址 - /// </summary> - public string FallbackURL { set; get; } - - public DownloadParam(int failedTryAgain, int timeout) - { - FailedTryAgain = failedTryAgain; - Timeout = timeout; - } - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/DownloadSystem/DownloadParam.cs.meta b/Assets/YooAsset/Runtime/DownloadSystem/DownloadParam.cs.meta deleted file mode 100644 index 85286202..00000000 --- a/Assets/YooAsset/Runtime/DownloadSystem/DownloadParam.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 56ea224b45d314e4a86b558404e9b6c8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultBuildinFileSystem/DefaultBuildinFileSystem.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultBuildinFileSystem/DefaultBuildinFileSystem.cs index 94665bf0..d061b6ea 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultBuildinFileSystem/DefaultBuildinFileSystem.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultBuildinFileSystem/DefaultBuildinFileSystem.cs @@ -113,11 +113,11 @@ namespace YooAsset { return _unpackFileSystem.ClearCacheFilesAsync(manifest, options); } - public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param) + public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options) { // 注意:业务层的解压下载器会依赖内置文件系统的下载方法 - param.ImportFilePath = GetBuildinFileLoadPath(bundle); - return _unpackFileSystem.DownloadFileAsync(bundle, param); + options.ImportFilePath = GetBuildinFileLoadPath(bundle); + return _unpackFileSystem.DownloadFileAsync(bundle, options); } public virtual FSLoadBundleOperation LoadBundleFile(PackageBundle bundle) { diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/DefaultCacheFileSystem.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/DefaultCacheFileSystem.cs index dcd99d0e..15d32796 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/DefaultCacheFileSystem.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/DefaultCacheFileSystem.cs @@ -154,9 +154,9 @@ namespace YooAsset return operation; } } - public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param) + public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options) { - var downloader = DownloadCenter.DownloadFileAsync(bundle, param); + var downloader = DownloadCenter.DownloadFileAsync(bundle, options); downloader.Reference(); //增加下载器的引用计数 // 注意:将下载器进行包裹,可以避免父类任务终止的时候,连带子任务里的下载器也一起被终止! diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/DCFSLoadBundleOperation.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/DCFSLoadBundleOperation.cs index dff1153c..2aefef9f 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/DCFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/DCFSLoadBundleOperation.cs @@ -58,8 +58,8 @@ namespace YooAsset // 注意:边玩边下下载器引用计数没有Release if (_downloadFileOp == null) { - DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60); - _downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam); + DownloadFileOptions options = new DownloadFileOptions(int.MaxValue, 60); + _downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, options); _downloadFileOp.StartOperation(); AddChildOperation(_downloadFileOp); } @@ -297,8 +297,8 @@ namespace YooAsset // 注意:边玩边下下载器引用计数没有Release if (_downloadFileOp == null) { - DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60); - _downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam); + DownloadFileOptions options = new DownloadFileOptions(int.MaxValue, 60); + _downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, options); _downloadFileOp.StartOperation(); AddChildOperation(_downloadFileOp); } diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadCenterOperation.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadCenterOperation.cs index 09fa9514..047414f0 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadCenterOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadCenterOperation.cs @@ -74,7 +74,7 @@ namespace YooAsset /// <summary> /// 创建下载任务 /// </summary> - public FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param) + public FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options) { // 查询旧的下载器 if (_downloaders.TryGetValue(bundle.BundleGUID, out var oldDownloader)) @@ -83,29 +83,29 @@ namespace YooAsset } // 设置请求URL - if (string.IsNullOrEmpty(param.ImportFilePath)) + if (string.IsNullOrEmpty(options.ImportFilePath)) { - param.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(bundle.FileName); - param.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(bundle.FileName); + options.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(bundle.FileName); + options.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(bundle.FileName); } else { // 注意:把本地文件路径指定为远端下载地址 - param.MainURL = DownloadSystemHelper.ConvertToWWWPath(param.ImportFilePath); - param.FallbackURL = param.MainURL; + options.MainURL = DownloadSystemHelper.ConvertToWWWPath(options.ImportFilePath); + options.FallbackURL = options.MainURL; } // 创建新的下载器 DefaultDownloadFileOperation newDownloader; if (bundle.FileSize >= _fileSystem.ResumeDownloadMinimumSize) { - newDownloader = new DownloadResumeFileOperation(_fileSystem, bundle, param); + newDownloader = new DownloadResumeFileOperation(_fileSystem, bundle, options); AddChildOperation(newDownloader); _downloaders.Add(bundle.BundleGUID, newDownloader); } else { - newDownloader = new DownloadNormalFileOperation(_fileSystem, bundle, param); + newDownloader = new DownloadNormalFileOperation(_fileSystem, bundle, options); AddChildOperation(newDownloader); _downloaders.Add(bundle.BundleGUID, newDownloader); } diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadNormalFileOperation.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadNormalFileOperation.cs index e50210ed..a4d6f77b 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadNormalFileOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadNormalFileOperation.cs @@ -12,13 +12,13 @@ namespace YooAsset private string _tempFilePath; private ESteps _steps = ESteps.None; - internal DownloadNormalFileOperation(DefaultCacheFileSystem fileSystem, PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal DownloadNormalFileOperation(DefaultCacheFileSystem fileSystem, PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { _fileSystem = fileSystem; } internal override void InternalStart() { - _isReuqestLocalFile = DownloadSystemHelper.IsRequestLocalFile(Param.MainURL); + _isReuqestLocalFile = DownloadSystemHelper.IsRequestLocalFile(Options.MainURL); _tempFilePath = _fileSystem.GetTempFilePath(Bundle); _steps = ESteps.CheckExists; } diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadResumeFileOperation.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadResumeFileOperation.cs index 9fab65dc..a96fc1a7 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadResumeFileOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultCacheFileSystem/Operation/internal/DownloadResumeFileOperation.cs @@ -15,13 +15,13 @@ namespace YooAsset private ESteps _steps = ESteps.None; - internal DownloadResumeFileOperation(DefaultCacheFileSystem fileSystem, PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal DownloadResumeFileOperation(DefaultCacheFileSystem fileSystem, PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { _fileSystem = fileSystem; } internal override void InternalStart() { - _isReuqestLocalFile = DownloadSystemHelper.IsRequestLocalFile(Param.MainURL); + _isReuqestLocalFile = DownloadSystemHelper.IsRequestLocalFile(Options.MainURL); _tempFilePath = _fileSystem.GetTempFilePath(Bundle); _steps = ESteps.CheckExists; } diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultEditorFileSystem/DefaultEditorFileSystem.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultEditorFileSystem/DefaultEditorFileSystem.cs index 27007622..b4108bc2 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultEditorFileSystem/DefaultEditorFileSystem.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultEditorFileSystem/DefaultEditorFileSystem.cs @@ -71,7 +71,7 @@ namespace YooAsset var operation = new FSClearCacheFilesCompleteOperation(); return operation; } - public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param) + public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options) { throw new System.NotImplementedException(); } diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultWebRemoteFileSystem/DefaultWebRemoteFileSystem.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultWebRemoteFileSystem/DefaultWebRemoteFileSystem.cs index 80aedffd..45c20696 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultWebRemoteFileSystem/DefaultWebRemoteFileSystem.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultWebRemoteFileSystem/DefaultWebRemoteFileSystem.cs @@ -78,7 +78,7 @@ namespace YooAsset var operation = new FSClearCacheFilesCompleteOperation(); return operation; } - public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param) + public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options) { throw new System.NotImplementedException(); } diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultWebRemoteFileSystem/Operation/DWRFSLoadBundleOperation.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultWebRemoteFileSystem/Operation/DWRFSLoadBundleOperation.cs index 8327dced..de18f0d2 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultWebRemoteFileSystem/Operation/DWRFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultWebRemoteFileSystem/Operation/DWRFSLoadBundleOperation.cs @@ -34,19 +34,19 @@ namespace YooAsset { if (_downloadAssetBundleOp == null) { - DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60); - downloadParam.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); - downloadParam.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(_bundle.FileName); + DownloadFileOptions options = new DownloadFileOptions(int.MaxValue, 60); + options.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); + options.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(_bundle.FileName); if (_bundle.Encrypted) { - _downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, downloadParam); + _downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, options); _downloadAssetBundleOp.StartOperation(); AddChildOperation(_downloadAssetBundleOp); } else { - _downloadAssetBundleOp = new DownloadWebNormalAssetBundleOperation(_fileSystem.DisableUnityWebCache, _bundle, downloadParam); + _downloadAssetBundleOp = new DownloadWebNormalAssetBundleOperation(_fileSystem.DisableUnityWebCache, _bundle, options); _downloadAssetBundleOp.StartOperation(); AddChildOperation(_downloadAssetBundleOp); } diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultWebServerFileSystem/DefaultWebServerFileSystem.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultWebServerFileSystem/DefaultWebServerFileSystem.cs index ae2547ba..a910c202 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultWebServerFileSystem/DefaultWebServerFileSystem.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultWebServerFileSystem/DefaultWebServerFileSystem.cs @@ -87,7 +87,7 @@ namespace YooAsset var operation = new FSClearCacheFilesCompleteOperation(); return operation; } - public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param) + public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options) { throw new System.NotImplementedException(); } diff --git a/Assets/YooAsset/Runtime/FileSystem/DefaultWebServerFileSystem/Operation/DWSFSLoadBundleOperation.cs b/Assets/YooAsset/Runtime/FileSystem/DefaultWebServerFileSystem/Operation/DWSFSLoadBundleOperation.cs index dbe03643..120601b0 100644 --- a/Assets/YooAsset/Runtime/FileSystem/DefaultWebServerFileSystem/Operation/DWSFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/DefaultWebServerFileSystem/Operation/DWSFSLoadBundleOperation.cs @@ -34,20 +34,20 @@ namespace YooAsset { if (_downloadAssetBundleOp == null) { - DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60); + DownloadFileOptions options = new DownloadFileOptions(int.MaxValue, 60); string fileLoadPath = _fileSystem.GetWebFileLoadPath(_bundle); - downloadParam.MainURL = DownloadSystemHelper.ConvertToWWWPath(fileLoadPath); - downloadParam.FallbackURL = downloadParam.MainURL; + options.MainURL = DownloadSystemHelper.ConvertToWWWPath(fileLoadPath); + options.FallbackURL = options.MainURL; if (_bundle.Encrypted) { - _downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, downloadParam); + _downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, options); _downloadAssetBundleOp.StartOperation(); AddChildOperation(_downloadAssetBundleOp); } else { - _downloadAssetBundleOp = new DownloadWebNormalAssetBundleOperation(_fileSystem.DisableUnityWebCache, _bundle, downloadParam); + _downloadAssetBundleOp = new DownloadWebNormalAssetBundleOperation(_fileSystem.DisableUnityWebCache, _bundle, options); _downloadAssetBundleOp.StartOperation(); AddChildOperation(_downloadAssetBundleOp); } diff --git a/Assets/YooAsset/Runtime/FileSystem/Interface/IFileSystem.cs b/Assets/YooAsset/Runtime/FileSystem/Interface/IFileSystem.cs index e6e01802..fb55c52c 100644 --- a/Assets/YooAsset/Runtime/FileSystem/Interface/IFileSystem.cs +++ b/Assets/YooAsset/Runtime/FileSystem/Interface/IFileSystem.cs @@ -42,8 +42,8 @@ namespace YooAsset /// <summary> /// 下载Bundle文件 /// </summary> - FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param); - + FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options); + /// <summary> /// 加载Bundle文件 /// </summary> diff --git a/Assets/YooAsset/Runtime/FileSystem/Operation/FSDownloadFileOperation.cs b/Assets/YooAsset/Runtime/FileSystem/Operation/FSDownloadFileOperation.cs index b2165ef5..d9f1a170 100644 --- a/Assets/YooAsset/Runtime/FileSystem/Operation/FSDownloadFileOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/Operation/FSDownloadFileOperation.cs @@ -1,6 +1,40 @@ namespace YooAsset { + internal class DownloadFileOptions + { + /// <summary> + /// 失败后重试次数 + /// </summary> + public readonly int FailedTryAgain; + + /// <summary> + /// 超时时间 + /// </summary> + public readonly int Timeout; + + /// <summary> + /// 主资源地址 + /// </summary> + public string MainURL { set; get; } + + /// <summary> + /// 备用资源地址 + /// </summary> + public string FallbackURL { set; get; } + + /// <summary> + /// 导入的本地文件路径 + /// </summary> + public string ImportFilePath { set; get; } + + public DownloadFileOptions(int failedTryAgain, int timeout) + { + FailedTryAgain = failedTryAgain; + Timeout = timeout; + } + } + internal abstract class FSDownloadFileOperation : AsyncOperationBase { public PackageBundle Bundle { private set; get; } diff --git a/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DefaultDownloadFileOperation.cs b/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DefaultDownloadFileOperation.cs index e37d300b..60cc3b39 100644 --- a/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DefaultDownloadFileOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DefaultDownloadFileOperation.cs @@ -18,7 +18,7 @@ namespace YooAsset } // 下载参数 - protected readonly DownloadParam Param; + protected readonly DownloadFileOptions Options; // 请求相关 protected UnityWebRequest _webRequest; @@ -35,10 +35,10 @@ namespace YooAsset protected int FailedTryAgain; - internal DefaultDownloadFileOperation(PackageBundle bundle, DownloadParam param) : base(bundle) + internal DefaultDownloadFileOperation(PackageBundle bundle, DownloadFileOptions options) : base(bundle) { - Param = param; - FailedTryAgain = param.FailedTryAgain; + Options = options; + FailedTryAgain = options.FailedTryAgain; } /// <summary> @@ -49,9 +49,9 @@ namespace YooAsset // 轮流返回请求地址 _requestCount++; if (_requestCount % 2 == 0) - return Param.FallbackURL; + return Options.FallbackURL; else - return Param.MainURL; + return Options.MainURL; } /// <summary> @@ -87,7 +87,7 @@ namespace YooAsset } float offset = UnityEngine.Time.realtimeSinceStartup - _latestDownloadRealtime; - if (offset > Param.Timeout) + if (offset > Options.Timeout) { YooLogger.Warning($"Download request timeout : {_requestURL}"); if (_webRequest != null) diff --git a/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadAssetBundleOperation.cs b/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadAssetBundleOperation.cs index 8c261f79..29f28362 100644 --- a/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadAssetBundleOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadAssetBundleOperation.cs @@ -4,7 +4,7 @@ namespace YooAsset { internal abstract class DownloadAssetBundleOperation : DefaultDownloadFileOperation { - internal DownloadAssetBundleOperation(PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal DownloadAssetBundleOperation(PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { } diff --git a/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadWebEncryptAssetBundleOperation.cs b/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadWebEncryptAssetBundleOperation.cs index 9424b3a2..8c0c43c3 100644 --- a/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadWebEncryptAssetBundleOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadWebEncryptAssetBundleOperation.cs @@ -10,7 +10,7 @@ namespace YooAsset private DownloadHandlerBuffer _downloadhandler; private ESteps _steps = ESteps.None; - internal DownloadWebEncryptAssetBundleOperation(bool checkTimeout, IWebDecryptionServices decryptionServices, PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal DownloadWebEncryptAssetBundleOperation(bool checkTimeout, IWebDecryptionServices decryptionServices, PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { _checkTimeout = checkTimeout; _decryptionServices = decryptionServices; diff --git a/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadWebNormalAssetBundleOperation.cs b/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadWebNormalAssetBundleOperation.cs index 527999b9..b58bbca9 100644 --- a/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadWebNormalAssetBundleOperation.cs +++ b/Assets/YooAsset/Runtime/FileSystem/Operation/Internal/DownloadWebNormalAssetBundleOperation.cs @@ -9,7 +9,7 @@ namespace YooAsset private DownloadHandlerAssetBundle _downloadhandler; private ESteps _steps = ESteps.None; - internal DownloadWebNormalAssetBundleOperation(bool disableUnityWebCache, PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal DownloadWebNormalAssetBundleOperation(bool disableUnityWebCache, PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { _disableUnityWebCache = disableUnityWebCache; } diff --git a/Assets/YooAsset/Runtime/ResourcePackage/BundleInfo.cs b/Assets/YooAsset/Runtime/ResourcePackage/BundleInfo.cs index b6bd1aff..09a6db29 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/BundleInfo.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/BundleInfo.cs @@ -38,9 +38,9 @@ namespace YooAsset /// </summary> public FSDownloadFileOperation CreateDownloader(int failedTryAgain, int timeout) { - DownloadParam downloadParam = new DownloadParam(failedTryAgain, timeout); - downloadParam.ImportFilePath = _importFilePath; - return _fileSystem.DownloadFileAsync(Bundle, downloadParam); + DownloadFileOptions options = new DownloadFileOptions(failedTryAgain, timeout); + options.ImportFilePath = _importFilePath; + return _fileSystem.DownloadFileAsync(Bundle, options); } /// <summary> diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/TTFSDownloadFileOperation.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/TTFSDownloadFileOperation.cs index 3ee15b0d..d79c8903 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/TTFSDownloadFileOperation.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/TTFSDownloadFileOperation.cs @@ -8,7 +8,7 @@ internal class TTFSDownloadFileOperation : DefaultDownloadFileOperation private TiktokFileSystem _fileSystem; private ESteps _steps = ESteps.None; - internal TTFSDownloadFileOperation(TiktokFileSystem fileSystem, PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal TTFSDownloadFileOperation(TiktokFileSystem fileSystem, PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { _fileSystem = fileSystem; } diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/TTFSLoadBundleOperation.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/TTFSLoadBundleOperation.cs index 1b1887e4..a7e8773c 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/TTFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/TTFSLoadBundleOperation.cs @@ -35,19 +35,19 @@ internal class TTFSLoadBundleOperation : FSLoadBundleOperation { if (_downloadAssetBundleOp == null) { - DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60); - downloadParam.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); ; - downloadParam.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(_bundle.FileName); + DownloadFileOptions options = new DownloadFileOptions(int.MaxValue, 60); + options.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); ; + options.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(_bundle.FileName); if (_bundle.Encrypted) { - _downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(false, _fileSystem.DecryptionServices, _bundle, downloadParam); + _downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(false, _fileSystem.DecryptionServices, _bundle, options); _downloadAssetBundleOp.StartOperation(); AddChildOperation(_downloadAssetBundleOp); } else { - _downloadAssetBundleOp = new DownloadTiktokAssetBundleOperation(_bundle, downloadParam); + _downloadAssetBundleOp = new DownloadTiktokAssetBundleOperation(_bundle, options); _downloadAssetBundleOp.StartOperation(); AddChildOperation(_downloadAssetBundleOp); } diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/internal/DownloadTiktokAssetBundleOperation.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/internal/DownloadTiktokAssetBundleOperation.cs index ffb8364e..d3f23268 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/internal/DownloadTiktokAssetBundleOperation.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/Operation/internal/DownloadTiktokAssetBundleOperation.cs @@ -8,7 +8,7 @@ namespace YooAsset { private ESteps _steps = ESteps.None; - internal DownloadTiktokAssetBundleOperation(PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal DownloadTiktokAssetBundleOperation(PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { } internal override void InternalStart() diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/TiktokFileSystem.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/TiktokFileSystem.cs index f356fdda..ab13aec0 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/TiktokFileSystem.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/TiktokFileSystem/TiktokFileSystem.cs @@ -129,11 +129,11 @@ internal class TiktokFileSystem : IFileSystem var operation = new FSClearCacheFilesCompleteOperation(); return operation; } - public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param) + public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options) { - param.MainURL = RemoteServices.GetRemoteMainURL(bundle.FileName); - param.FallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName); - var operation = new TTFSDownloadFileOperation(this, bundle, param); + options.MainURL = RemoteServices.GetRemoteMainURL(bundle.FileName); + options.FallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName); + var operation = new TTFSDownloadFileOperation(this, bundle, options); return operation; } public virtual FSLoadBundleOperation LoadBundleFile(PackageBundle bundle) diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSDownloadFileOperation.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSDownloadFileOperation.cs index dc631ec6..c9c8ede7 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSDownloadFileOperation.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSDownloadFileOperation.cs @@ -9,7 +9,7 @@ internal class WXFSDownloadFileOperation : DefaultDownloadFileOperation private WechatFileSystem _fileSystem; private ESteps _steps = ESteps.None; - internal WXFSDownloadFileOperation(WechatFileSystem fileSystem, PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal WXFSDownloadFileOperation(WechatFileSystem fileSystem, PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { _fileSystem = fileSystem; } diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs index fe17c9b4..e0ce2a7c 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs @@ -33,19 +33,19 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation { if (_downloadAssetBundleOp == null) { - DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60); - downloadParam.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); ; - downloadParam.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(_bundle.FileName); + DownloadFileOptions options = new DownloadFileOptions(int.MaxValue, 60); + options.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); ; + options.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(_bundle.FileName); if (_bundle.Encrypted) { - _downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(false, _fileSystem.DecryptionServices, _bundle, downloadParam); + _downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(false, _fileSystem.DecryptionServices, _bundle, options); _downloadAssetBundleOp.StartOperation(); AddChildOperation(_downloadAssetBundleOp); } else { - _downloadAssetBundleOp = new DownloadWechatAssetBundleOperation(_bundle, downloadParam); + _downloadAssetBundleOp = new DownloadWechatAssetBundleOperation(_bundle, options); _downloadAssetBundleOp.StartOperation(); AddChildOperation(_downloadAssetBundleOp); } diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/internal/DownloadWechatAssetBundleOperation.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/internal/DownloadWechatAssetBundleOperation.cs index f7212a17..ae9393d2 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/internal/DownloadWechatAssetBundleOperation.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/internal/DownloadWechatAssetBundleOperation.cs @@ -8,7 +8,7 @@ namespace YooAsset { private ESteps _steps = ESteps.None; - internal DownloadWechatAssetBundleOperation(PackageBundle bundle, DownloadParam param) : base(bundle, param) + internal DownloadWechatAssetBundleOperation(PackageBundle bundle, DownloadFileOptions options) : base(bundle, options) { } internal override void InternalStart() diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs index 696e0f0b..788293d1 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs @@ -144,11 +144,11 @@ internal class WechatFileSystem : IFileSystem return operation; } } - public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadParam param) + public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options) { - param.MainURL = RemoteServices.GetRemoteMainURL(bundle.FileName); - param.FallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName); - var operation = new WXFSDownloadFileOperation(this, bundle, param); + options.MainURL = RemoteServices.GetRemoteMainURL(bundle.FileName); + options.FallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName); + var operation = new WXFSDownloadFileOperation(this, bundle, options); return operation; } public virtual FSLoadBundleOperation LoadBundleFile(PackageBundle bundle)