/// <summary>
/// Remove a package. All resources in this package will be disposed.
/// </summary>
/// <param name="packageIdOrName"></param>
/// <param name="allowDestroyingAssets"></param>
public static void RemovePackage(string packageIdOrName)
{
UIPackage pkg = null;
if (!_packageInstById.TryGetValue(packageIdOrName, out pkg))
{
if (!_packageInstByName.TryGetValue(packageIdOrName, out pkg))
{
// LLWANT: 不抛异常,只输出日志提示
Debug.Log("FairyGUI: '" + packageIdOrName + "' is not a valid package id or name. maybe removed");
return;
}
}
pkg.Dispose();
_packageInstById.Remove(pkg.id);
if (pkg._customId != null)
{
_packageInstById.Remove(pkg._customId);
}
if (pkg.assetPath != null)
{
_packageInstById.Remove(pkg.assetPath);
}
_packageInstByName.Remove(pkg.name);
_packageList.Remove(pkg);
}