//历史记录 public override void history2CallBack(DiceHistoryDto callBackParam) { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); //历史记录显示 diceGameMove.HistoryShow(callBackParam); }
public void HistoryShow(DiceHistoryDto diceHistoryDto) { //历史记录页面显示 iRPanel.gameObject.SetActive(true); TouchPanel.gameObject.SetActive(true); //进行由大到小的冒泡排序 for (int i = 0; i < diceHistoryDto.diceCountDtos.Count; i++) { for (int j = i + 1; j < diceHistoryDto.diceCountDtos.Count; j++) { if (diceHistoryDto.diceCountDtos[j].battleCount > diceHistoryDto.diceCountDtos[i].battleCount) { DiceCountDto temp = diceHistoryDto.diceCountDtos[j]; diceHistoryDto.diceCountDtos[j] = diceHistoryDto.diceCountDtos[i]; diceHistoryDto.diceCountDtos[i] = temp; } } //排好顺序加入新链表 newHisdtoList.Add(diceHistoryDto.diceCountDtos[i]); } for (int i = 0; i < newHisdtoList.Count; i++) { //更换图片 HistoryList[i].GetChild(0).GetComponent <Image>().sprite = HistoryImaList[newHisdtoList[i].one - 1]; HistoryList[i].GetChild(0).gameObject.SetActive(true); HistoryList[i].GetChild(1).GetComponent <Image>().sprite = HistoryImaList[newHisdtoList[i].two - 1]; HistoryList[i].GetChild(1).gameObject.SetActive(true); if (newHisdtoList[i].one == newHisdtoList[i].two) { HistoryList[i].GetChild(3).GetComponent <Text>().text = "围骰"; HistoryList[i].GetChild(2).GetComponent <Text>().text = (newHisdtoList[i].one + newHisdtoList[i].two).ToString(); } else { if ((newHisdtoList[i].one + newHisdtoList[i].two) > 6) { HistoryList[i].GetChild(2).GetComponent <Text>().text = (newHisdtoList[i].one + newHisdtoList[i].two).ToString(); HistoryList[i].GetChild(3).GetComponent <Text>().text = "大"; } else { HistoryList[i].GetChild(2).GetComponent <Text>().text = (newHisdtoList[i].one + newHisdtoList[i].two).ToString(); HistoryList[i].GetChild(3).GetComponent <Text>().text = "小"; } } } newHisdtoList.Clear(); }
/// <summary> /// ----> <<history();回调>> /// </summary> public virtual void history2CallBack(DiceHistoryDto callBackParam) { }