refactor : 重构异步操作模块

This commit is contained in:
何冠峰
2026-01-12 16:10:24 +08:00
parent 294fa18fec
commit 7198e639d9
4 changed files with 57 additions and 20 deletions
+3 -14
View File
@@ -59,6 +59,7 @@ namespace YooAsset
_driver.AddComponent<RemoteDebuggerInRuntime>();
#endif
// 初始化异步操作系统
OperationSystem.Initialize();
}
}
@@ -75,8 +76,8 @@ namespace YooAsset
if (_driver != null)
GameObject.Destroy(_driver);
// 终止并清空所有包裹的异步操作
ClearAllPackageOperation();
// 销毁异步操作系统
OperationSystem.DestroyAll();
// 卸载所有AssetBundle
AssetBundle.UnloadAllAssetBundles(true);
@@ -97,18 +98,6 @@ namespace YooAsset
}
}
/// <summary>
/// 终止并清空所有包裹的异步操作
/// </summary>
internal static void ClearAllPackageOperation()
{
foreach (var package in _packages)
{
OperationSystem.ClearPackageOperation(package.PackageName);
}
OperationSystem.DestroyAll();
}
/// <summary>
/// 创建资源包裹
/// </summary>