update runtime code

重构了OperationSystem的机制。从列表模式修改为链模式
This commit is contained in:
何冠峰
2025-02-25 12:18:16 +08:00
parent 400c2ccefe
commit c758aa81ff
72 changed files with 385 additions and 260 deletions

View File

@@ -62,8 +62,13 @@ namespace YooAsset
if (_steps == ESteps.InitFileSystem)
{
if (_initFileSystemOp == null)
{
_initFileSystemOp = _impl.EditorFileSystem.InitializeFileSystemAsync();
_initFileSystemOp.StartOperation();
AddChildOperation(_initFileSystemOp);
}
_initFileSystemOp.UpdateOperation();
Progress = _initFileSystemOp.Progress;
if (_initFileSystemOp.IsDone == false)
return;
@@ -99,8 +104,6 @@ namespace YooAsset
private readonly OfflinePlayModeImpl _impl;
private readonly OfflinePlayModeParameters _parameters;
private FSInitializeFileSystemOperation _initFileSystemOp;
private FSRequestPackageVersionOperation _requestPackageVersionOp;
private FSLoadPackageManifestOperation _loadPackageManifestOp;
private ESteps _steps = ESteps.None;
internal OfflinePlayModeInitializationOperation(OfflinePlayModeImpl impl, OfflinePlayModeParameters parameters)
@@ -142,8 +145,13 @@ namespace YooAsset
if (_steps == ESteps.InitFileSystem)
{
if (_initFileSystemOp == null)
{
_initFileSystemOp = _impl.BuildinFileSystem.InitializeFileSystemAsync();
_initFileSystemOp.StartOperation();
AddChildOperation(_initFileSystemOp);
}
_initFileSystemOp.UpdateOperation();
Progress = _initFileSystemOp.Progress;
if (_initFileSystemOp.IsDone == false)
return;
@@ -221,8 +229,13 @@ namespace YooAsset
if (_steps == ESteps.InitBuildinFileSystem)
{
if (_initBuildinFileSystemOp == null)
{
_initBuildinFileSystemOp = _impl.BuildinFileSystem.InitializeFileSystemAsync();
_initBuildinFileSystemOp.StartOperation();
AddChildOperation(_initBuildinFileSystemOp);
}
_initBuildinFileSystemOp.UpdateOperation();
Progress = _initBuildinFileSystemOp.Progress;
if (_initBuildinFileSystemOp.IsDone == false)
return;
@@ -264,8 +277,13 @@ namespace YooAsset
if (_steps == ESteps.InitCacheFileSystem)
{
if (_initCacheFileSystemOp == null)
{
_initCacheFileSystemOp = _impl.CacheFileSystem.InitializeFileSystemAsync();
_initCacheFileSystemOp.StartOperation();
AddChildOperation(_initCacheFileSystemOp);
}
_initCacheFileSystemOp.UpdateOperation();
Progress = _initCacheFileSystemOp.Progress;
if (_initCacheFileSystemOp.IsDone == false)
return;
@@ -344,8 +362,13 @@ namespace YooAsset
if (_steps == ESteps.InitWebServerFileSystem)
{
if (_initWebServerFileSystemOp == null)
{
_initWebServerFileSystemOp = _impl.WebServerFileSystem.InitializeFileSystemAsync();
_initWebServerFileSystemOp.StartOperation();
AddChildOperation(_initWebServerFileSystemOp);
}
_initWebServerFileSystemOp.UpdateOperation();
Progress = _initWebServerFileSystemOp.Progress;
if (_initWebServerFileSystemOp.IsDone == false)
return;
@@ -385,8 +408,13 @@ namespace YooAsset
if (_steps == ESteps.InitWebRemoteFileSystem)
{
if (_initWebRemoteFileSystemOp == null)
{
_initWebRemoteFileSystemOp = _impl.WebRemoteFileSystem.InitializeFileSystemAsync();
_initWebRemoteFileSystemOp.StartOperation();
AddChildOperation(_initWebRemoteFileSystemOp);
}
_initWebRemoteFileSystemOp.UpdateOperation();
Progress = _initWebRemoteFileSystemOp.Progress;
if (_initWebRemoteFileSystemOp.IsDone == false)
return;