public static void RemovePackage(string packageIdOrName, bool allowDestroyingAssets)
{
UIPackage pkg = null;
if (!_packageInstById.TryGetValue(packageIdOrName, out pkg))
{
if (!_packageInstByName.TryGetValue(packageIdOrName, out pkg))
throw new Exception("FairyGUI: '" + packageIdOrName + "' is not a valid package id or name.");
}
pkg.Dispose(allowDestroyingAssets);
_packageInstById.Remove(packageIdOrName);
if (pkg._customId != null)
_packageInstById.Remove(pkg._customId);
if (pkg.assetPath != null)
_packageInstById.Remove(pkg.assetPath);
_packageInstByName.Remove(pkg.name);
_packageList.Remove(pkg);
}