public void UpdateToNew() { if (HasNewVersion) { // 读取本地ab包的清单 localAssetBundleList = localManager.AseetBundleList; // 读取远程ab包的清单 remoteAssetBundleList = remoteManager.AseetBundleList; IEnumerable <AssetBundleInfo> updateList; if (localAssetBundleList.Count == 0) { updateList = remoteAssetBundleList; } else { // 获取更新列表 updateList = from remoteab in remoteAssetBundleList from localab in localAssetBundleList where localab.HasNewVersion(remoteab) || !localAssetBundleList.Contains(remoteab) select remoteab; } // 开始下载 remoteManager.DownloadAssetBundles(updateList, remoteVersion); // 清空本地不用的ab包 localManager.Clear(ABUtility.GetDeleteABList(localAssetBundleList, remoteAssetBundleList)); // 写入新的信息文件 localManager.Version = remoteVersion; localManager.AseetBundleList = remoteAssetBundleList; } }
public void StartUpdate() { // 开始下载 remoteManager.StartDownload(); // 清空本地不用的ab包 localManager.Clear(localAssetBundleList, remoteAssetBundleList); // 写入新的信息文件 localManager.Version = remoteVersion; localManager.AseetBundleList = remoteAssetBundleList; }