update operation logic

This commit is contained in:
何冠峰
2024-07-07 16:01:55 +08:00
parent 25231ecd32
commit 260867b588
46 changed files with 525 additions and 678 deletions
@@ -17,20 +17,5 @@ namespace YooAsset
_saveFileRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.SaveFilesFolderName);
_tempFileRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.TempFilesFolderName);
}
public override FSLoadBundleOperation LoadBundleFile(PackageBundle bundle)
{
if (RawFileBuildPipeline)
{
var operation = new DUFSLoadRawBundleOperation(this, bundle);
OperationSystem.StartOperation(PackageName, operation);
return operation;
}
else
{
var operation = new DUFSLoadAssetBundleOperation(this, bundle);
OperationSystem.StartOperation(PackageName, operation);
return operation;
}
}
}
}
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 59b123e460757694180175970bf28826
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,57 +0,0 @@
namespace YooAsset
{
internal class DUFSLoadAssetBundleOperation : DCFSLoadAssetBundleOperation
{
public DUFSLoadAssetBundleOperation(DefaultUnpackFileSystem fileSystem, PackageBundle bundle) : base(fileSystem, bundle)
{
}
public override void WaitForAsyncComplete()
{
_isWaitForAsyncComplete = true;
while (true)
{
// 文件解压
if (_downloadFileOp != null)
{
if (_downloadFileOp.IsDone == false)
_downloadFileOp.WaitForAsyncComplete();
}
// 驱动流程
InternalOnUpdate();
// 完成后退出
if (IsDone)
break;
}
}
}
internal class DUFSLoadRawBundleOperation : DCFSLoadRawBundleOperation
{
public DUFSLoadRawBundleOperation(DefaultUnpackFileSystem fileSystem, PackageBundle bundle) : base(fileSystem, bundle)
{
}
public override void WaitForAsyncComplete()
{
while (true)
{
// 文件解压
if (_downloadFileOp != null)
{
if (_downloadFileOp.IsDone == false)
_downloadFileOp.WaitForAsyncComplete();
}
// 驱动流程
InternalOnUpdate();
// 完成后退出
if (IsDone)
break;
}
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 47f6fe3a815d28e49815db7c09c1fa76
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: