FairyGUI.UIPackage.RemovePackage C# (CSharp) Method

RemovePackage() public static method

Remove a package. All resources in this package will be disposed.
public static RemovePackage ( string packageIdOrName, bool allowDestroyingAssets ) : void
packageIdOrName string
allowDestroyingAssets bool
return void
        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);
        }

Same methods

UIPackage::RemovePackage ( string packageIdOrName ) : void