refactor : 重构代码
This commit is contained in:
+7
-6
@@ -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;
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ namespace YooAsset
|
||||
|
||||
if (_steps == ESteps.VerifyFileData)
|
||||
{
|
||||
if (ManifestTools.VerifyManifestData(_fileData, _packageHash))
|
||||
if (PackageManifestTools.VerifyManifestData(_fileData, _packageHash))
|
||||
{
|
||||
_steps = ESteps.LoadManifest;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user