update resource manager

优化ForceUnloadAllAssets方法逻辑
This commit is contained in:
hevinci
2023-10-19 19:39:14 +08:00
parent 194afe435a
commit d30a8aefa4
9 changed files with 82 additions and 32 deletions

View File

@@ -300,7 +300,13 @@ namespace YooAsset
public UpdatePackageManifestOperation UpdatePackageManifestAsync(string packageVersion, bool autoSaveVersion = true, int timeout = 60)
{
DebugCheckInitialize(false);
DebugCheckUpdateManifest();
// 注意:强烈建议在更新之前保持加载器为空!
if (_resourceMgr.HasAnyLoader())
{
YooLogger.Warning($"Found loaded bundle before update manifest ! Recommended to call the {nameof(ForceUnloadAllAssets)} method to release loaded bundle !");
}
return _playModeImpl.UpdatePackageManifestAsync(packageVersion, autoSaveVersion, timeout);
}
@@ -1128,16 +1134,6 @@ namespace YooAsset
}
}
[Conditional("DEBUG")]
private void DebugCheckUpdateManifest()
{
var loadedBundleInfos = _resourceMgr.GetLoadedBundleInfos();
if (loadedBundleInfos.Count > 0)
{
YooLogger.Warning($"Found loaded bundle before update manifest ! Recommended to call the {nameof(ForceUnloadAllAssets)} method to release loaded bundle !");
}
}
[Conditional("DEBUG")]
private void DebugCheckRawFileLoadMethod(string method)
{