refactor : 重构代码

This commit is contained in:
何冠峰
2026-01-16 10:28:01 +08:00
parent 2b6e7856e7
commit b0e85017d2
100 changed files with 1042 additions and 1582 deletions
@@ -93,21 +93,22 @@ namespace YooAsset
var operation = new DEFSLoadPackageManifestOperation(this, options.PackageVersion);
return operation;
}
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(PackageManifest manifest, ClearCacheFilesOptions options)
public virtual FSClearCacheFilesOperation ClearCacheFilesAsync(ClearCacheFilesOptions options)
{
var operation = new FSClearCacheFilesCompleteOperation();
return operation;
}
public virtual FSDownloadFileOperation DownloadFileAsync(PackageBundle bundle, DownloadFileOptions options)
public virtual FSDownloadFileOperation DownloadFileAsync(DownloadFileOptions options)
{
string mainURL = bundle.BundleName;
string mainURL = options.Bundle.BundleName;
options.SetURL(mainURL, mainURL);
var downloader = new DownloadVirtualBundleOperation(this, bundle, options);
var downloader = new DownloadVirtualBundleOperation(this, options);
return downloader;
}
public virtual FSLoadBundleOperation LoadBundleFile(PackageBundle bundle)
public virtual FSLoadBundleOperation LoadBundleAsync(LoadBundleOptions options)
{
if (bundle.BundleType == (int)EBuildBundleType.VirtualBundle)
PackageBundle bundle = options.Bundle;
if (bundle.BundleType == (int)EBundleType.VirtualBundle)
{
var operation = new DEFSLoadBundleOperation(this, bundle);
return operation;
@@ -64,8 +64,8 @@ namespace YooAsset
{
if (_downloadFileOp == null)
{
DownloadFileOptions options = new DownloadFileOptions(int.MaxValue);
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, options);
DownloadFileOptions options = new DownloadFileOptions(_bundle, int.MaxValue);
_downloadFileOp = _fileSystem.DownloadFileAsync(options);
_downloadFileOp.StartOperation();
AddChildOperation(_downloadFileOp);
}
@@ -25,7 +25,7 @@ namespace YooAsset
private ESteps _steps = ESteps.None;
internal DownloadVirtualBundleOperation(DefaultEditorFileSystem fileSystem, PackageBundle bundle, DownloadFileOptions options) : base(bundle)
internal DownloadVirtualBundleOperation(DefaultEditorFileSystem fileSystem, DownloadFileOptions options) : base(options.Bundle)
{
_fileSystem = fileSystem;
_options = options;
@@ -59,7 +59,7 @@ namespace YooAsset
if (_steps == ESteps.VerifyFileData)
{
if (ManifestTools.VerifyManifestData(_fileData, _packageHash))
if (PackageManifestTools.VerifyManifestData(_fileData, _packageHash))
{
_steps = ESteps.LoadManifest;
}