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); }
public static void UnLoadUI(string uipath, bool destroyRes) { UIPackage pkg = UIPackage.GetByName(uipath); if (null != pkg) { pkg.UnloadAssets(); } }
public static void RemovePackage(string pkgName) { UIPackage pkg = UIPackage.GetByName(pkgName); if (pkg != null) { pkg.UnloadAssets(); UIPackage.RemovePackage(pkgName); } }
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; }
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(); } }