private void UpdateDLAll_Progress() { if (this.DLAllList != null) { foreach (string key in this.DLAllList.Keys) { AB_DownLoad_ALLInfo ab_DownLoad_ALLInfo = this.DLAllList[key]; if (!ab_DownLoad_ALLInfo.bIsAllEnd) { float num = 0f; if (ab_DownLoad_ALLInfo.cur_abdlI.www != null) { num = ab_DownLoad_ALLInfo.cur_abdlI.www.progress; } ab_DownLoad_ALLInfo.cur_abdlI.progress = num; float num2 = (float)ab_DownLoad_ALLInfo.dlFCT; float num3 = (float)ab_DownLoad_ALLInfo.dlFCT_COMP; if (num2 < 1f) { num2 = 1f; } float num4 = 1f / num2; float progressAll = num3 / num2 + num4 * num; ab_DownLoad_ALLInfo.progressAll = progressAll; } else { ab_DownLoad_ALLInfo.progressAll = 1f; } } } }
private void UpdateDownLoad() { if (AssetBundleMng.Instance() == null) { return; } if (AssetBundleMng.Instance().IsStopDownload()) { return; } if (this.curInfoIDX > -1) { if (this.curInfoIDX < this.abidList.Count) { if (this.dlList.Count < this.currentDownloadStream) { int dlallCount = AssetBundleMng.Instance().GetDLAllCount(this.abidList[this.curInfoIDX]); if (dlallCount > 0) { AssetBundleMng.Instance().DownLoad_AllAssetBundleData(this.abidList[this.curInfoIDX].name, this.abidList[this.curInfoIDX], null); this.dlList.Add(this.abidList[this.curInfoIDX].name, this.abidList[this.curInfoIDX]); } this.curInfoIDX++; } } else if (this.curInfoIDX >= this.abidList.Count && this.dlList.Count < this.currentDownloadStream) { int odlstreamNum = this.currentDownloadStream - this.dlList.Count; AssetBundleMng.Instance().SetODLStreamNum(odlstreamNum); } foreach (string text in this.dlList.Keys) { AB_DownLoad_ALLInfo ab_DownLoad_ALLInfo = AssetBundleMng.Instance().GetAB_DownLoad_ALLInfo(text); if (ab_DownLoad_ALLInfo != null && ab_DownLoad_ALLInfo.bIsAllEnd) { this.dlList.Remove(text); if (ab_DownLoad_ALLInfo.cur_abdlI != null && ab_DownLoad_ALLInfo.cur_abdlI.www != null) { ab_DownLoad_ALLInfo.cur_abdlI.www.Dispose(); } GC.Collect(); break; } } if (this.curInfoIDX >= this.abidList.Count && this.dlList.Count == 0) { this.isAssetBundleDownloading = false; this.curInfoIDX = -1; } } }
public List <DLProgressInfo> GetAll_AB_DownloadStreamProgress() { List <DLProgressInfo> list = new List <DLProgressInfo>(); foreach (string name in this.dlList.Keys) { AB_DownLoad_ALLInfo ab_DownLoad_ALLInfo = AssetBundleMng.Instance().GetAB_DownLoad_ALLInfo(name); if (ab_DownLoad_ALLInfo != null && !ab_DownLoad_ALLInfo.bIsAllEnd) { list.Add(new DLProgressInfo { name = ab_DownLoad_ALLInfo.abid.name, progress = ab_DownLoad_ALLInfo.progressAll, fct = ab_DownLoad_ALLInfo.dlFCT, fct_comp = ab_DownLoad_ALLInfo.dlFCT_COMP }); } } return(list); }
public void DownLoad_AllAssetBundleData(string name, AssetBundleInfoData abid, Action<int> actAllEnd) { if (this.DLAllList.ContainsKey(name)) { global::Debug.LogError("===================================== AssetBundleMng:DownLoad_AllAssetBundleData = " + name + "既にあります!"); } else { AB_DownLoad_ALLInfo ab_DownLoad_ALLInfo = new AB_DownLoad_ALLInfo(); ab_DownLoad_ALLInfo.ABM_Instance = this; ab_DownLoad_ALLInfo.abid = abid; ab_DownLoad_ALLInfo.actEndCallBackAll = actAllEnd; ab_DownLoad_ALLInfo.execFCT = 0; ab_DownLoad_ALLInfo.progressFCT = 0; ab_DownLoad_ALLInfo.progressAll = 0f; ab_DownLoad_ALLInfo.dlFCT = this.GetDLAllCount(abid); ab_DownLoad_ALLInfo.dlFCT_COMP = 0; ab_DownLoad_ALLInfo.bIsAllEnd = false; ab_DownLoad_ALLInfo.cur_abdlI = this.DownLoad_OneAssetBundleData(ab_DownLoad_ALLInfo.abid.name, ab_DownLoad_ALLInfo.abid.ver, ab_DownLoad_ALLInfo.abid.abPath, ab_DownLoad_ALLInfo.abid.assetBundleInfoList[ab_DownLoad_ALLInfo.execFCT++], new Action<AssetBundle, AB_DownLoadInfo>(ab_DownLoad_ALLInfo.EndCallBackOne), false); this.DLAllList.Add(name, ab_DownLoad_ALLInfo); } }