//---------------------------------------------------------------------------- private void SixInSix() { var before = Profiler.GetTotalAllocatedMemoryLong(); curRedBallSelNumber = drawData.redBallSelNumberList.Count; curBlueBallSelNumber = drawData.blueBallSelNumberList.Count; var blueBallCount = drawData.blueBallSelNumberList.Count; long totalCount; List <ResultData> combinResult = new List <ResultData>(); if (m_ballRotation.isOn) { totalCount = Util.C(drawData.redBallSelNumberList.Count, Six); Util.GetCombination(ref combinResult, drawData.redBallSelNumberList, Six, drawData.blueBallSelNumberList, true); } else { totalCount = Util.C(drawData.redBallSelNumberList.Count, Six) * blueBallCount; System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); Util.GetCombination(ref combinResult, drawData.redBallSelNumberList, Six, drawData.blueBallSelNumberList, false); //Util.Combination(ref combinResult, drawData.redBallSelNumberList, drawData.redBallSelNumberList.Count, Six); sw.Stop(); Debug.LogError(string.Format("中六保六缩水数据花费时间为: {0} ms", sw.ElapsedMilliseconds)); } var end = Profiler.GetTotalAllocatedMemoryLong(); Debug.LogError(string.Format("中六保六所分配堆内存:{0}M", (end - before) / (1024 * 1024))); m_totalLab.text = string.Format(PromptData.GetPrompt("totalbets"), totalCount); m_totalLab.color = UseColor.pink; drawData.resultList.Clear(); drawData.resultList = combinResult; UpdateLoopView(combinResult, loopScrollView); }
//---------------------------------------------------------------------------- private void OnBegin() { if (clearTogIsOn || !IsAnyToggleIsOn()) { Messenger.Broadcast <string, object>(DgMsgID.DgMsg_ShowUIOneParam, "UIErrorCtrl", PromptData.GetPrompt("setFilters")); return; } else if (allTogIsOn) { var numberList = unPopularNumberData.numberList; for (int i = 0; i < numberList.Count; i++) { var curNum = numberList[i]; if (!drawData.redBallSelNumberList.Contains(curNum)) { drawData.redBallSelNumberList.Add(curNum); } } m_totalAfter.text = string.Format(PromptData.GetPrompt("afterFilterTotal"), drawData.resultList.Count * drawData.blueBallSelNumberList.Count); UpdateLoopView(drawData.resultList, afterLoopScrollView); } else { drawData.resultList = Util.GetResult(unPopularNumberData.numberList, initialFilterResults, selectNumList); m_totalAfter.text = string.Format(PromptData.GetPrompt("afterFilterTotal"), drawData.resultList.Count); UpdateLoopView(drawData.resultList, afterLoopScrollView); } }
//---------------------------------------------------------------------------- public void SetSumPanelView() { foreach (var list in unPopularNumberData.dict) { for (int i = 0; i < m_SumTemp.Count; i++) { if (list.Key == i) { m_SumTemp[i].SetView(list.Key, list.Value); } if (!unPopularNumberData.dict.ContainsKey(i)) { m_SumTemp[i].ShowOrHide(false); } } } string str = string.Empty; var numberList = unPopularNumberData.numberList; for (int i = 0; i < numberList.Count; i++) { if (i == 0) { str = numberList[i].ToString(); } else { str += "," + numberList[i]; } } m_populatLab.text = string.Format(PromptData.GetPrompt("unpopularNumThis"), str); }
//---------------------------------------------------------------------------- public void SetView(int number, int count) { curNum = number; num.text = string.Format(PromptData.GetPrompt("piece"), number); totalNum.text = count.ToString(); m_goRect.anchoredPosition3D = new Vector3(0, 100, 0); m_goRect.pivot = new Vector2(0.5f, 0); m_goRect.sizeDelta += new Vector2(0, count / 10.0f); }
//---------------------------------------------------------------------------- private void OnBeginRedeem() { if (redeemList.Count > 0) { redeemList.Clear(); } var selRedData = drawData.redeemDict[drawData.curSelectPeriod]; for (int i = 0; i < m_winningResult.Count; i++) { var curLevel = int.Parse(m_winningResult[i].gameObject.name); var result = Util.GetRedemptionDataList(curLevel, selRedData, m_initialFilterResults); switch (curLevel) { case 1: m_winningResult[curLevel - 1].text = string.Format(PromptData.GetPrompt("firstPrize"), result.Count); break; case 2: m_winningResult[curLevel - 1].text = string.Format(PromptData.GetPrompt("secondPrize"), result.Count); break; case 3: m_winningResult[curLevel - 1].text = string.Format(PromptData.GetPrompt("thirdPrize"), result.Count); break; case 4: m_winningResult[curLevel - 1].text = string.Format(PromptData.GetPrompt("fourthPrize"), result.Count); break; case 5: m_winningResult[curLevel - 1].text = string.Format(PromptData.GetPrompt("fifthPrize"), result.Count); break; case 6: m_winningResult[curLevel - 1].text = string.Format(PromptData.GetPrompt("sixthPrize"), result.Count); break; default: break; } if (result != null) { foreach (var item in result) { redeemList.Add(item); } } } UpdateLoopView(redeemList, m_winResultScroll); }
//---------------------------------------------------------------------------- private void UpdateTotalShow() { var redBallCount = drawData.redBallSelNumberList.Count; var blueBallCount = drawData.blueBallSelNumberList.Count; if (redBallCount >= 6 && blueBallCount > 0) { m_totalLab.text = string.Format(PromptData.GetPrompt("totalbets"), Util.C(drawData.redBallSelNumberList.Count, 6) * blueBallCount); } else { m_totalLab.text = string.Empty; } }
//---------------------------------------------------------------------------- private void OnBegin() { if (clearTogIsOn || !IsAnyToggleIsOn()) { Messenger.Broadcast <string, object>(DgMsgID.DgMsg_ShowUIOneParam, "UIErrorCtrl", PromptData.GetPrompt("setFilters")); return; } else if (allTogIsOn) { m_totalAfter.text = string.Format(PromptData.GetPrompt("afterFilterTotal"), drawData.resultList.Count); UpdateLoopView(drawData.resultList, afterLoopScrollView); } else { drawData.resultList = Util.GetMantissaFilterResult(initialFilterResults, selectTypeList); m_totalAfter.text = string.Format(PromptData.GetPrompt("afterFilterTotal"), drawData.resultList.Count); UpdateLoopView(drawData.resultList, afterLoopScrollView); } }
//---------------------------------------------------------------------------- protected virtual void UpdateLoopView(List <ResultData> list, LoopScrollerView scrollView) { scrollView.Init(list.Count, (index, item) => { var tran = item.transform; list[index].redBallList.Sort(SortList); var list1 = list[index].redBallList; var blueBall = list[index].blueBall; for (int j = 0; j < list1.Count; j++) { if (list1[j] < 10) { tran.Find(string.Format("{0}", j + 1)).GetComponent <Text>().text = string.Format(PromptData.GetPrompt("lessThanTen"), list1[j]); } else { tran.Find(string.Format("{0}", j + 1)).GetComponent <Text>().text = list1[j].ToString(); } } if (blueBall < 10) { tran.Find("blue").GetComponent <Text>().text = string.Format(PromptData.GetPrompt("lessThanTen"), blueBall); } else { tran.Find("blue").GetComponent <Text>().text = blueBall.ToString(); } tran.Find("serial").GetComponent <Text>().text = (index + 1).ToString(); var levelLab = tran.Find("level"); if (levelLab != null) { levelLab.GetComponent <Text>().text = string.Format(PromptData.GetPrompt("prizeLevel"), list[index].level); } }); }
//---------------------------------------------------------------------------- private void OnDropValueChanged(int index) { drawData.curSelectPeriod = drawData.tcbStatiDataList[index].numperiods; m_prizeNum.text = string.Format(PromptData.GetPrompt("prizeNum"), drawData.tcbStatiDataList[index].prizeNumber); }
//---------------------------------------------------------------------------- private void SixInFive() { curRedBallSelNumber = drawData.redBallSelNumberList.Count; if (curRedBallSelNumber < 8 || curRedBallSelNumber > 12) { Messenger.Broadcast <string, object>(DgMsgID.DgMsg_ShowUIOneParam, "UIErrorCtrl", PromptData.GetPrompt("selNumLimit")); return; } curBlueBallSelNumber = drawData.blueBallSelNumberList.Count; var blueBallCount = drawData.blueBallSelNumberList.Count; long totalCount; var list = RotationMatrix.GetRotationMatrixResult(curRedBallSelNumber, drawData.redBallSelNumberList); if (m_ballRotation.isOn) { totalCount = list.Count; } else { totalCount = list.Count * blueBallCount; } m_totalLab.text = string.Format(PromptData.GetPrompt("totalbets"), totalCount); m_totalLab.color = UseColor.pink; drawData.resultList.Clear(); drawData.resultList = list; UpdateLoopView(list, loopScrollView); }
//---------------------------------------------------------------------------- private void ShowView() { var redDataList = drawData.redBallSelNumberList; for (int i = 0; i < redDataList.Count; i++) { var name = redDataList[i].ToString(); if (redBallCloneDict.Count > 0 && redBallCloneDict != null) { if (redBallCloneDict.ContainsKey(name)) { redBallCloneDict[name].Visible(true); } else { var redTemp = Object.Instantiate(selectedRedBallTemp, selectedRedBallParent) as GameObject; redTemp.name = name; redTemp.transform.localScale = Vector3.one; redTemp.transform.localRotation = Quaternion.identity; redTemp.transform.Find("Label").GetComponent <Text>().text = name; redTemp.Visible(true); redBallCloneDict.Add(name, redTemp); } } else { var redTemp = Object.Instantiate(selectedRedBallTemp, selectedRedBallParent) as GameObject; redTemp.name = name; redTemp.transform.localScale = Vector3.one; redTemp.transform.localRotation = Quaternion.identity; redTemp.transform.Find("Label").GetComponent <Text>().text = name; redTemp.Visible(true); redBallCloneDict.Add(name, redTemp); } } var blueDataList = drawData.blueBallSelNumberList; for (int i = 0; i < blueDataList.Count; i++) { var name = blueDataList[i].ToString(); if (blueBallCloneDict.Count > 0 && blueBallCloneDict != null) { if (blueBallCloneDict.ContainsKey(name)) { blueBallCloneDict[name].Visible(true); } else { var redTemp = Object.Instantiate(selectedBlueBallTemp, selectedBlueBallParent) as GameObject; redTemp.name = name; redTemp.transform.localScale = Vector3.one; redTemp.transform.localRotation = Quaternion.identity; redTemp.transform.Find("Label").GetComponent <Text>().text = name; redTemp.Visible(true); blueBallCloneDict.Add(name, redTemp); } } else { var redTemp = Object.Instantiate(selectedBlueBallTemp, selectedBlueBallParent) as GameObject; redTemp.name = name; redTemp.transform.localScale = Vector3.one; redTemp.transform.localRotation = Quaternion.identity; redTemp.transform.Find("Label").GetComponent <Text>().text = name; redTemp.Visible(true); blueBallCloneDict.Add(name, redTemp); } } m_redBallLab.text = string.Format(PromptData.GetPrompt("redBallColor"), drawData.redBallSelNumberList.Count); m_redBallLab.color = UseColor.red; m_blueBallLab.text = string.Format(PromptData.GetPrompt("blueBallColor"), drawData.blueBallSelNumberList.Count); m_blueBallLab.color = UseColor.blue; }