Ejemplo n.º 1
0
    public static void Destroy(GUIBase ui)
    {
        PackageInfo package = packageDic[ui.packageName];

        package.referencedCount--;

        ui.Destory();
        uiViewDic.Remove(ui.uiName);

        string packageBundleName = string.Format("ui/{0}.bundle", package.packageName.ToLower());

        AssetLoadManager.UnLoadAssetBundle(packageBundleName);

        if (package.referencedCount == 0)
        {
            UIPackage.RemovePackage(package.packageName);
            packageDic.Remove(package.packageName);
        }
    }