mirror of https://github.com/tuyoogame/YooAsset
parent
29358a7b4b
commit
70fc85e456
|
@ -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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销毁资源包
|
||||
/// </summary>
|
||||
/// <param name="package">资源包对象</param>
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检测资源包是否存在
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue