示例#1
0
 public bool UnLoadAssets(string winName)
 {
     ReferenceCount--;
     if (ReferenceCount <= 0 || string.IsNullOrEmpty(winName))
     {
         for (loading.Begin(); loading.Next();)
         {
             loading.Value.Destroy();
         }
         loading.Clear();
         for (dependences.Begin(); dependences.Next();)
         {
             dependences.Value.Destroy();
         }
         dependences.Clear();
         loadingWins.Clear();
         package.UnloadAssets();
         return(true);
     }
     else if (loadingWins.Contains(winName))
     {
         loadingWins.Remove(winName);
     }
     return(false);
 }
示例#2
0
        public static void UnLoadUI(string uipath, bool destroyRes)
        {
            UIPackage pkg = UIPackage.GetByName(uipath);

            if (null != pkg)
            {
                pkg.UnloadAssets();
            }
        }
示例#3
0
        public static void RemovePackage(string pkgName)
        {
            UIPackage pkg = UIPackage.GetByName(pkgName);

            if (pkg != null)
            {
                pkg.UnloadAssets();
                UIPackage.RemovePackage(pkgName);
            }
        }
示例#4
0
 public void UnloadAssets(string packageName)
 {
     try
     {
         UIPackage package = UIPackage.GetByName(packageName);
         package.UnloadAssets();
     }
     catch (Exception e)
     {
         Debug.LogError(e);
     }
     #if UNITY_EDITOR
     UnityEditor.EditorApplication.isPlaying = false;
     #endif
     return;
 }
示例#5
0
        public static void UnloadUI(string uipath)
        {
            if (string.IsNullOrEmpty(uipath))
            {
                return;
            }
            string id = uipath;

            if (m_pkgDir.ContainsKey(uipath))
            {
                id = m_pkgDir[uipath];
            }
            if (m_abDir.ContainsKey(uipath))
            {
                m_abDir.Remove(uipath);
            }
            UIPackage pkg = UIPackage.GetById(id);

            if (null != pkg)
            {
                pkg.UnloadAssets();
            }
        }