public override void WriteUpToDate() { IServerVersionFileManifest versionFileManifest = FileManifestManager.Get <IServerVersionFileManifest>(); List <string> allABVersion = versionFileManifest.GetABVersion(); if (allABVersion.Count <= 0) { return; } IServerAssetBundleFileManifest serverFenbao = FileManifestManager.Get <IServerAssetBundleFileManifest>(); Dictionary <string, List <AssetDataInfo> > assetDatas = serverFenbao.GetAllAssetBundle(); string lastVersion = allABVersion[allABVersion.Count - 1]; if (assetDatas.ContainsKey(lastVersion)) { Dictionary <string, AssetDataInfo> temp = new Dictionary <string, AssetDataInfo>(); var itr = assetDatas[lastVersion].GetEnumerator(); while (itr.MoveNext()) { temp.Add(itr.Current.Name, itr.Current); } itr.Dispose(); WriteToLocal(temp, true); } }
protected Dictionary <string, List <AssetDataInfo> > GetAllDatas() { Dictionary <string, List <AssetDataInfo> > datas = new Dictionary <string, List <AssetDataInfo> >(); Dictionary <string, List <AssetDataInfo> > fenBaoAllPackage = serverFenbao.GetAllPackage(); Dictionary <string, List <AssetDataInfo> > abAll = serverAssetBundle.GetAllAssetBundle(); var itr = fenBaoAllPackage.Keys.GetEnumerator(); while (itr.MoveNext()) { if (!datas.ContainsKey(itr.Current)) { datas.Add(itr.Current, new List <AssetDataInfo>()); } datas[itr.Current].AddRange(fenBaoAllPackage[itr.Current]); } itr.Dispose(); var abItr = abAll.Keys.GetEnumerator(); while (abItr.MoveNext()) { if (datas.ContainsKey(abItr.Current)) { Debug.LogError("分包版本和散包版本相同??????" + abItr.Current); break; } datas.Add(abItr.Current, new List <AssetDataInfo>()); datas[abItr.Current].AddRange(abAll[abItr.Current]); } abItr.Dispose(); return(datas); }