/// <summary> /// 真正从内存卸载包(已判定不是常驻的并且为引用) /// </summary> /// <param name="abName"></param> private void RemoveLoadedBundle(string abName) { LoadedBundle cache = null; m_loadedBundles.TryGetValue(abName, out cache); if (cache != null) { cache.Unload(); m_loadedBundles.Remove(abName); } else { Util.LogWarning(string.Format("移除加载完的包失败,不存在该包:{0}", abName)); } }
/// <summary> /// 手动移除没被引用的包(等不及定时清理了:场景包等) /// </summary> /// <param name="abName"></param> public void HandRemoveBundle(string abName) { LoadedBundle cache = null; m_loadedBundles.TryGetValue(abName, out cache); if (null != cache) { if (cache.IsCanRemove) { cache.Unload(); m_loadedBundles.Remove(abName); } else { Util.LogWarning("手动移除包失败,该包还被引用中: " + abName); } } else { Util.LogWarning("移除加载完的包失败,不存在该包: " + abName); } }