From 989d88f7d35a2fdeff9e19977c40667d1cd3a7a9 Mon Sep 17 00:00:00 2001 From: hevinci Date: Sat, 22 Oct 2022 15:37:53 +0800 Subject: [PATCH] Update runtime code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复资源回收无效的问题。 --- Assets/YooAsset/Runtime/AssetsPackage.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Assets/YooAsset/Runtime/AssetsPackage.cs b/Assets/YooAsset/Runtime/AssetsPackage.cs index 5692d8b..a5f770b 100644 --- a/Assets/YooAsset/Runtime/AssetsPackage.cs +++ b/Assets/YooAsset/Runtime/AssetsPackage.cs @@ -122,6 +122,7 @@ namespace YooAsset } // 监听初始化结果 + _isInitialize = true; initializeOperation.Completed += InitializeOperation_Completed; return initializeOperation; } @@ -298,11 +299,9 @@ namespace YooAsset /// public void UnloadUnusedAssets() { - if (_isInitialize) - { - _assetSystemImpl.Update(); - _assetSystemImpl.UnloadUnusedAssets(); - } + DebugCheckInitialize(); + _assetSystemImpl.Update(); + _assetSystemImpl.UnloadUnusedAssets(); } /// @@ -310,10 +309,8 @@ namespace YooAsset /// public void ForceUnloadAllAssets() { - if (_isInitialize) - { - _assetSystemImpl.ForceUnloadAllAssets(); - } + DebugCheckInitialize(); + _assetSystemImpl.ForceUnloadAllAssets(); } @@ -982,9 +979,12 @@ namespace YooAsset #endregion #region 调试信息 - internal List GetDebugReportInfos() + internal DebugPackageData GetDebugPackageData() { - return _assetSystemImpl.GetDebugReportInfos(); + DebugPackageData data = new DebugPackageData(); + data.PackageName = PackageName; + data.ProviderInfos = _assetSystemImpl.GetDebugReportInfos(); + return data; } #endregion