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

@@ -10,7 +10,8 @@ namespace YooAsset
protected enum ESteps
{
None = 0,
LoadBundleFile,
StartBundleLoader,
WaitBundleLoader,
ProcessBundleResult,
Done,
}
@@ -99,14 +100,24 @@ namespace YooAsset
internal override void InternalStart()
{
DebugBeginRecording();
_steps = ESteps.LoadBundleFile;
_steps = ESteps.StartBundleLoader;
}
internal override void InternalUpdate()
{
if (_steps == ESteps.None || _steps == ESteps.Done)
return;
if (_steps == ESteps.LoadBundleFile)
if (_steps == ESteps.StartBundleLoader)
{
foreach (var bundleLoader in _bundleLoaders)
{
bundleLoader.StartOperation();
AddChildOperation(bundleLoader);
}
_steps = ESteps.WaitBundleLoader;
}
if (_steps == ESteps.WaitBundleLoader)
{
if (IsWaitForAsyncComplete)
{
@@ -116,6 +127,13 @@ namespace YooAsset
}
}
// 更新资源包加载器
foreach (var bundleLoader in _bundleLoaders)
{
bundleLoader.UpdateOperation();
}
// 检测加载是否完成
foreach (var bundleLoader in _bundleLoaders)
{
if (bundleLoader.IsDone == false)
@@ -128,6 +146,7 @@ namespace YooAsset
}
}
// 检测加载结果
BundleResultObject = _mainBundleLoader.Result;
if (BundleResultObject == null)
{