public override void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            base.Dispose();

            if (this.checkForResUpdatelPackage != null)
            {
                var p = UIPackage.GetByName(checkForResUpdatelPackage.name);

                if (p != null)
                {
                    UIPackage.RemovePackage(checkForResUpdatelPackage.name);
                }

                checkForResUpdatelPackage = null;
            }

            if (this.loadingPackage != null)
            {
                var p = UIPackage.GetByName(loadingPackage.name);

                if (p != null)
                {
                    UIPackage.RemovePackage(loadingPackage.name);
                }

                loadingPackage = null;
            }
        }
Ejemplo n.º 2
0
    /// <summary>
    /// 移除页面
    /// </summary>
    public void RemovePackage(string _comName)
    {
        GObject tempObj = GetFairyObject(_comName);

        if (tempObj == null)
        {
            LogError("tempObj value nil");
            return;
        }

        string tempPackageName = GetPackageName(_comName);

        if (string.IsNullOrEmpty(tempPackageName))
        {
            LogError("包资源为空,无法卸载");
            return;
        }

        string[] temp = tempPackageName.Split('#');
        if (temp == null || temp.Length < 2)
        {
            LogError("无法解析包名 --> " + tempPackageName);
            return;
        }

        tempObj.Dispose();
        packageList.Remove(tempPackageName);
        packageObjectList.Remove(tempPackageName);
        UIPackage.RemovePackage(temp[0], true);
    }
Ejemplo n.º 3
0
        public void RemovePackage(string type)
        {
            if (RemovePackageRef(type))
            {
                var p = UIPackage.GetByName(type);

                if (p != null)
                {
                    UIPackage.RemovePackage(type);
                }
            }

            /*UIPackage package;
             *
             * if(packages.TryGetValue(type, out package))
             * {
             *  var p = UIPackage.GetByName(package.name);
             *
             *  if (p != null)
             *  {
             *      UIPackage.RemovePackage(package.name);
             *  }
             *
             *  packages.Remove(package.name);
             * }*/

            if (!Define.IsEditorMode)
            {
                string uiBundleDesName = AssetBundleHelper.StringToAB($"{type}_fui");
                string uiBundleResName = AssetBundleHelper.StringToAB(type);
                Game.Scene.GetComponent <ResourcesComponent>().UnloadBundle(uiBundleDesName);
                Game.Scene.GetComponent <ResourcesComponent>().UnloadBundle(uiBundleResName);
            }
        }
Ejemplo n.º 4
0
        public override void UnloadFairyUIPackage(string packageName)
        {
            UIPackage.RemovePackage(packageName);
            string abName = ResHelper.GetABName(packageName);

            abMgr.UnloadABProxy(abName);
        }
Ejemplo n.º 5
0
 public void Dispose()
 {
     if (uiPackage != null)
     {
         UIPackage.RemovePackage(uiPackage.name);
     }
 }
Ejemplo n.º 6
0
    public void ReplaceScene(string uiPacList, Action func = null)
    {
        this.requestQueue = new Queue <Callback>();
        this.allIndex     = 0;
        this.curIndex     = 0;
        this.finish_func  = func;
        this.timer        = 1f;

        if (fairyGUIPackList != null)
        {
            Debug.Log(" 释放之前场景的 UI Fairy包 ");
            for (int i = 0; i < fairyGUIPackList.Length; i++)
            {
                string curPackName = fairyGUIPackList[i];
                requestQueue.Enqueue(delegate() { UIPackage.RemovePackage("UI/" + curPackName); });
                this.allIndex++;
            }
        }

        this.fairyGUIPackList = uiPacList.Split(":"[0]).Where(t => { return(!string.IsNullOrEmpty(t)); }).ToArray();
        Debug.Log(" 加载当前的UI Fairy包");

        for (int i = 0; i < fairyGUIPackList.Length; i++)
        {
            string curPackName = fairyGUIPackList[i];
            Debug.Log(" fairyGUIPackList[" + i + "] " + curPackName);
            requestQueue.Enqueue(delegate() { UIPackage.AddPackage("UI/" + curPackName); });
            this.allIndex++;
        }

        this.enabled = true;
    }
 /// <summary>
 /// Removes the package res
 /// </summary>
 public void RemovePackage(string packageName)
 {
     if (string.IsNullOrEmpty(packageName))
     {
         Debug.LogError("RemovePackage,packageName is null");
         return;
     }
     UIPackage.RemovePackage(packageName, true);
 }
Ejemplo n.º 8
0
    public void IncReferenceCount()
    {
        --reference;

        if (reference <= 0)
        {
            UIPackage.RemovePackage(PackageName);
        }
    }
Ejemplo n.º 9
0
        public void RemovePackage(string type)
        {
            this.packages.TryGetValue(type, out UIPackage package);
            UIPackage.RemovePackage(package.name);
            this.packages.Remove(package.name);
#if !UNITY_EDITOR
            ETModel.Game.Scene.GetComponent <ResourcesComponent>().UnloadBundle(type.StringToAB());
#endif
        }
Ejemplo n.º 10
0
        public static void RemovePackage(string pkgName)
        {
            UIPackage pkg = UIPackage.GetByName(pkgName);

            if (pkg != null)
            {
                pkg.UnloadAssets();
                UIPackage.RemovePackage(pkgName);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 卸载一个fairy gui 资源
        /// </summary>
        /// <param name="_assetName"></param>
        public void UnloadFairyGUIAsset(string _assetName)
        {
            if (true == string.IsNullOrEmpty(_assetName))
            {
                return;
            }

            UIPackage.RemovePackage(_assetName); // 卸载package
//            UnloadAsset(_assetName); // 卸载资源 由于没有通过LoadAsset加载,所以无需在此处进行调用
        }
Ejemplo n.º 12
0
 public void Release()
 {
     if (loader != null)
     {
         loader.Unload();
         loader = null;
     }
     UIPackage.RemovePackage(packageId);
     package = null;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 离开场景
 /// </summary>
 public void Leave()
 {
     if (IsUnLoad)
     {
         //卸载资源
         for (int i = 0; i < AssetsGroup.Length; i++)
         {
             UIPackage.RemovePackage(AssetsGroup[i]);
         }
     }
 }
Ejemplo n.º 14
0
    public static void RemovePackage(string packageName)
    {
        if (_lstLoadedUIPackage.ContainsKey(packageName))
        {
            _lstLoadedUIPackage.Remove(packageName);
        }
        UIPackage.RemovePackage(packageName, true);
//#if UNITY_EDITOR
//        if (Core.Editor)
//            return;
//#endif
//        AssetManager.DisposeAssetBundle(GamePath.UI + packageName);
    }
    /// <summary>
    /// 卸载一个FairyGUI资源
    /// </summary>
    /// <param name="_assetName"></param>
    public void UnloadFairyGUIAsset(string _assetName)
    {
        if (true == string.IsNullOrEmpty(_assetName))
        {
            return;
        }

        // 卸载fairy gui package
        UIPackage.RemovePackage(_assetName);

        // 卸载asset bundle
        UnloadAsset(_assetName);
    }
Ejemplo n.º 16
0
 public void RemovePackage(string packageName)
 {
     UIPackage.RemovePackage(packageName);
     if (assets.ContainsKey(packageName))
     {
         UIAsset uiAsset = assets[packageName];
         uiAsset.Drop();
     }
     else
     {
         Debug.LogError("no package:" + packageName);
     }
 }
Ejemplo n.º 17
0
        public void RemovePackage(string pname)
        {
            if (packages.ContainsKey(pname))
            {
                packages[pname]--;

                if (packages[pname] <= 0)
                {
                    packages.Remove(pname);

                    UIPackage.RemovePackage(pname);
                }
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 移除一个包,并清理其asset
        /// </summary>
        /// <param name="type"></param>
        public void RemovePackage(string type)
        {
            UIPackage package;

            if (packages.TryGetValue(type, out package))
            {
                var p = UIPackage.GetByName(package.name);
                if (p != null)
                {
                    UIPackage.RemovePackage(package.name);
                }

                packages.Remove(package.name);
            }
        }
Ejemplo n.º 19
0
 /// <summary>
 /// 卸载已经加载的包
 /// </summary>
 /// <param name="packageName">包名</param>
 public void RemovePackage(string packageName)
 {
     try
     {
         UIPackage.RemovePackage(packageName);
         _packageAddDict.Remove(packageName);
     }
     catch (Exception e)
     {
         Debug.LogError(e);
         #if UNITY_EDITOR
         UnityEditor.EditorApplication.isPlaying = false;
         #endif
     }
 }
Ejemplo n.º 20
0
        /// <summary>
        /// 移除FairGUI的UIPackage,如果没有引用了就直接移除,否则移除引用计数
        /// </summary>
        /// <param name="packagePath"></param>
        public void RemovePackage(string packagePath)
        {
            MyUIPackage myUiPackage;

            if (m_UIPackages.TryGetValue(packagePath, out myUiPackage))
            {
                myUiPackage.ReferenceCount--;
                if (myUiPackage.ReferenceCount <= 0)
                {
                    string packageAssetPath = AssetUtility.GetFairyGuiPackageAsset(packagePath);
                    UIPackage.RemovePackage(packageAssetPath);
                }
                m_UIPackages.Remove(packagePath);
            }
        }
Ejemplo n.º 21
0
        public void Close()
        {
            m_FormType = null;
            m_Serial   = 0;

            if (!m_UIPackageName.IsNullOrEmpty())
            {
                UIPackage.RemovePackage(m_UIPackageName);
                m_UIPackageName = null;
            }

            if (m_HUILogic != null)
            {
                m_HUILogic.OnDispose();
            }
        }
Ejemplo n.º 22
0
        public void RemovePackage(string packageName)
        {
            if (string.IsNullOrEmpty(packageName))
            {
                return;
            }

            if (!m_packageMap.ContainsKey(packageName))
            {
                return;
            }

            UIPackage.RemovePackage(packageName);

            m_packageMap.Remove(packageName);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 移除一个包,并清理其asset
        /// </summary>
        /// <param name="type"></param>
        public void RemovePackage(string type)
        {
            UIPackage package;

            if (s_Packages.TryGetValue(type, out package))
            {
                var p = UIPackage.GetByName(package.name);
                if (p != null)
                {
                    UIPackage.RemovePackage(package.name);
                    XAssetLoader.UnLoadAsset(XAssetPathUtilities.GetFGUIDesPath($"{type}_fui"));
                    XAssetLoader.UnLoadAsset(XAssetPathUtilities.GetFGUIResPath($"{type}_atlas0", ".png"));
                }

                s_Packages.Remove(package.name);
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 删除FGUIPackage的引用
        /// </summary>
        public void RemoveRef(string packageName)
        {
            int refCout;

            if (!m_FguiRef.TryGetValue(packageName, out refCout))
            {
                throw new GameFrameworkException(Utility.Text.Format("{0} is not exit", packageName));
            }

            m_FguiRef[packageName]--;

            if (m_FguiRef[packageName] <= 0 && UIPackage.GetPackages().Count != 0)
            {
                m_FguiRef.Remove(packageName);
                UIPackage.RemovePackage(packageName);
            }
        }
Ejemplo n.º 25
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);
        }
    }
Ejemplo n.º 26
0
        public override void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            base.Dispose();

            if (modelPackage != null)
            {
                var p = UIPackage.GetByName(modelPackage.name);

                if (p != null)
                {
                    UIPackage.RemovePackage(modelPackage.name);
                }

                modelPackage = null;
            }
        }
Ejemplo n.º 27
0
    public static void DestroyAll()
    {
        foreach (var pair in uiViewDic)
        {
            PackageInfo package = packageDic[pair.Value.packageName];
            package.referencedCount--;

            pair.Value.Destory();

            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);
            }
        }
        uiViewDic.Clear();
        packageDic.Clear();
    }
Ejemplo n.º 28
0
        public void RemovePackage(string type)
        {
            UIPackage package;

            if (packages.TryGetValue(type, out package))
            {
                var p = UIPackage.GetByName(package.name);

                if (p != null)
                {
                    UIPackage.RemovePackage(package.name);
                }

                packages.Remove(package.name);
            }

            if (!Define.ResModeIsEditor)
            {
                Game.Scene.GetComponent <ResourcesComponent>().UnLoadAsset(ABPathUtilities.GetFGUIDesPath($"{type}_fui"));
                Game.Scene.GetComponent <ResourcesComponent>().UnLoadAsset(ABPathUtilities.GetFGUIResPath($"{type}_atlas0"));
            }
        }
Ejemplo n.º 29
0
        public void RemovePackage(string type)
        {
            UIPackage package;

            if (packages.TryGetValue(type, out package))
            {
                var p = UIPackage.GetByName(package.name);

                if (p != null)
                {
                    UIPackage.RemovePackage(package.name);
                }

                packages.Remove(package.name);
            }

#if !UNITY_EDITOR
            string uiBundleDesName = $"{type}_fui".StringToAB();
            string uiBundleResName = type.StringToAB();
            ETModel.Game.Scene.GetComponent <ResourcesComponent>().UnloadBundle(uiBundleDesName);
            ETModel.Game.Scene.GetComponent <ResourcesComponent>().UnloadBundle(uiBundleResName);
#endif
        }
Ejemplo n.º 30
0
        public void RemovePackage(string type)
        {
            UIPackage package;

            if (packages.TryGetValue(type, out package))
            {
                var p = UIPackage.GetByName(package.name);

                if (p != null)
                {
                    UIPackage.RemovePackage(package.name);
                }

                packages.Remove(package.name);
            }

            if (Define.IsAsync)
            {
                string uiBundleDesName = AssetBundleHelper.StringToAB($"{type}_fui");
                string uiBundleResName = AssetBundleHelper.StringToAB(type);
                Game.Scene.GetComponent <ResourcesComponent>().UnloadBundle(uiBundleDesName);
                Game.Scene.GetComponent <ResourcesComponent>().UnloadBundle(uiBundleResName);
            }
        }