public fenBaoFileManifestTest() { FileManifestManager.Add <IServerFenbaoFileManifest>(this); _data_infos = new Dictionary <string, List <AssetDataInfo> >(); IServerVersionFileManifest versionFileManifest = FileManifestManager.Get <IServerVersionFileManifest>(); List <string> zipVersions = versionFileManifest.GetZipAllVersion(); int zipFileCount = 3; var itr = zipVersions.GetEnumerator(); int versionIndex = 1; while (itr.MoveNext()) { _data_infos.Add(itr.Current, new List <AssetDataInfo>()); for (int i = 0; i < zipFileCount; i++) { string name = string.Format(" Package{0}_{1}.zip", versionIndex, i); _data_infos[itr.Current].Add(BuildFenBao(name)); } versionIndex++; } itr.Dispose(); }
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); } }
public override void StartDownLoad() { VersionInfo info = FileManifestManager.Get <IServerVersionFileManifest>().GetLastVersin(); if (info == null) { return; } if (info.AssetBundleManifestNames == null) { return; } for (int i = 0; i < info.AssetBundleManifestNames.Length; i++) { AssetBundleDownLoadParam param = new AssetBundleDownLoadParam(info.AssetBundleManifestNames[i]); HttpDownLoadAsync httpDownLoadAsync = CreateHttpDownLoad(); AssetDownInfo downInfo = new AssetDownInfo(); downInfo.AssetName = info.AssetBundleManifestNames[i]; downInfo.Buffer.ByteSize = int.Parse(info.AssetBundleManifestLengths[i]); downInfo.MD5 = info.AssetBundleManifestMD5s[i]; downInfo.Index = i; _version_index.Add(i); httpDownLoadAsync.Setup(downInfo); httpDownLoadAsync.StartDownLoad(param); } }
public AssetBundleFileManifestTest() { FileManifestManager.Add <IServerAssetBundleFileManifest>(this); IServerVersionFileManifest versionFileManifest = FileManifestManager.Get <IServerVersionFileManifest>(); _data_infos = new Dictionary <string, List <AssetDataInfo> >(); List <string> abVersions = versionFileManifest.GetABVersion(); var itr = abVersions.GetEnumerator(); while (itr.MoveNext()) { _data_infos.Add(itr.Current, new List <AssetDataInfo>()); int count = 3; for (int i = 0; i < count; i++) { _data_infos[itr.Current].Add(BuildAssetData(itr.Current + "__" + i.ToString())); } } itr.Dispose(); }
public StrategyFactoryBase() { serverVersion = FileManifestManager.Get <IServerVersionFileManifest>(); serverAssetBundle = FileManifestManager.Get <IServerAssetBundleFileManifest>(); serverFenbao = FileManifestManager.Get <IServerFenbaoFileManifest>(); }
public AssetBundleFileDownLoad() { FileManifestManager.Add <IServerAssetBundleFileManifest>(this); _server_version = FileManifestManager.Get <IServerVersionFileManifest>(); _data_infos = new Dictionary <string, List <AssetDataInfo> >(); }
public VersionFileDownLoad() { FileManifestManager.Add <IServerVersionFileManifest>(this); _server_version_list = FileManifestManager.Get <IServerVersionListFileManifest>(); _version_infos = new Dictionary <string, VersionInfo>(); }
protected void VersionDownLoadComplete(string version) { IServerVersionFileManifest versionFile = FileManifestManager.Get <IServerVersionFileManifest>(); versionFile.WriteVersion(version); }
public FenbaoFileDownLoad() : base() { FileManifestManager.Add <IServerFenbaoFileManifest>(this); _all_zip = new Dictionary <string, List <AssetDataInfo> >(); _server_version = FileManifestManager.Get <IServerVersionFileManifest>(); }