diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs index 8f40902..9d0b965 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs @@ -346,6 +346,15 @@ namespace YooAsset report.ProviderInfos.Sort(); return report; } + internal static List GetLoadedBundleInfos() + { + List result = new List(100); + foreach (var bundleLoader in _loaders) + { + result.Add(bundleLoader.MainBundleInfo); + } + return result; + } #endregion } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/YooAssets.cs b/Assets/YooAsset/Runtime/YooAssets.cs index dbb1ed1..b7d7470 100644 --- a/Assets/YooAsset/Runtime/YooAssets.cs +++ b/Assets/YooAsset/Runtime/YooAssets.cs @@ -294,6 +294,7 @@ namespace YooAsset public static UpdateManifestOperation UpdateManifestAsync(int resourceVersion, int timeout = 60) { DebugCheckInitialize(); + DebugCheckUpdateManifest(); if (_playMode == EPlayMode.EditorSimulateMode) { var operation = new EditorPlayModeUpdateManifestOperation(); @@ -1130,6 +1131,16 @@ namespace YooAsset YooLogger.Warning($"Found illegal character in location : \"{location}\""); } } + + [Conditional("DEBUG")] + private static void DebugCheckUpdateManifest() + { + var loadedBundleInfos = AssetSystem.GetLoadedBundleInfos(); + if(loadedBundleInfos.Count > 0) + { + YooLogger.Warning($"Found loaded bundle before update manifest ! Recommended to call the {nameof(ForceUnloadAllAssets)} method to release loaded bundle !"); + } + } #endregion #region 私有方法