diff --git a/Assets/YooAsset/Runtime/YooAssets.cs b/Assets/YooAsset/Runtime/YooAssets.cs index 63d7819..07e8ef2 100644 --- a/Assets/YooAsset/Runtime/YooAssets.cs +++ b/Assets/YooAsset/Runtime/YooAssets.cs @@ -99,6 +99,7 @@ namespace YooAsset if (HasPackage(packageName)) throw new Exception($"Package {packageName} already existed !"); + YooLogger.Log($"Create resource package : {packageName}"); ResourcePackage package = new ResourcePackage(packageName); _packages.Add(package); return package; @@ -136,6 +137,21 @@ namespace YooAsset return null; } + /// + /// 销毁资源包 + /// + /// 资源包对象 + public static void DestroyPackage(string packageName) + { + ResourcePackage package = GetPackage(packageName); + if (package == null) + return; + + YooLogger.Log($"Destroy resource package : {packageName}"); + _packages.Remove(package); + package.DestroyPackage(); + } + /// /// 检测资源包是否存在 ///