From c11f072c508e01cae95ede82a504eeab08bddefe Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 28 Jul 2023 17:17:23 +0800 Subject: [PATCH] update asset system --- .../YooAsset/Runtime/AssetSystem/AssetSystem.cs | 10 ++++++---- .../AssetSystem/Loader/BundleLoaderBase.cs | 9 --------- .../Runtime/AssetSystem/Provider/ProviderBase.cs | 16 ---------------- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs index a44c3b0..c3825e9 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs @@ -128,11 +128,13 @@ namespace YooAsset #else foreach (var provider in _providerList) { - provider.DestroySafely(); + provider.WaitForAsyncComplete(); + provider.Destroy(); } foreach (var loader in _loaderList) { - loader.DestroySafely(); + loader.WaitForAsyncComplete(); + loader.Destroy(); } _providerList.Clear(); @@ -416,7 +418,7 @@ namespace YooAsset return null; } -#region 调试信息 + #region 调试信息 internal List GetDebugReportInfos() { List result = new List(_providerList.Count); @@ -444,6 +446,6 @@ namespace YooAsset } return result; } -#endregion + #endregion } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleLoaderBase.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleLoaderBase.cs index 5c517e0..12d3e4d 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleLoaderBase.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleLoaderBase.cs @@ -144,15 +144,6 @@ namespace YooAsset } } - /// - /// 销毁资源包(安全模式) - /// - public void DestroySafely() - { - WaitForAsyncComplete(); - Destroy(); - } - /// /// 轮询更新 diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs index 86ca7e8..68491dc 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs @@ -140,22 +140,6 @@ namespace YooAsset } } - /// - /// 销毁资源对象(安全模式) - /// - public void DestroySafely() - { - if (Status == EStatus.Loading || Status == EStatus.Checking) - { - WaitForAsyncComplete(); - Destroy(); - } - else - { - Destroy(); - } - } - /// /// 是否可以销毁 ///