public void TTLResponse(LotteryRoomInfoDto lotteryRoomInfoDto) { if (PlayerCache.TianTianLeObj == null) { PlayerCache.TianTianLeObj = UIManager.Instance.OpenUI <UITianTianLePanel>(PathStr.UI_TianTianLePanel_Path, null); PlayerCache.TianTianLeObj.name = "TianTianLe"; PlayerCache.TianTianLeObj.transform.SetParent(canvas); PlayerCache.TianTianLeObj.transform.localScale = Vector3.one; PlayerCache.TianTianLeObj.transform.localPosition = Vector3.zero; PlayerCache.TianTianLeObj.GetComponent <RectTransform>().offsetMin = Vector2.zero; PlayerCache.TianTianLeObj.GetComponent <RectTransform>().offsetMax = Vector2.zero; } else { PlayerCache.TianTianLeObj.transform.SetParent(canvas); PlayerCache.TianTianLeObj.transform.localScale = Vector3.one; PlayerCache.TianTianLeObj.SetActive(true); } if (PlayerCache.uITianTianLePanel != null) { PlayerCache.uITianTianLePanel.InRoom(lotteryRoomInfoDto); } }
/// <summary> /// 打开天天乐面板 /// </summary> private void BtnTianTianLeOnClick() { //进入房间 LotteryRoomInfoDto lotteryRoomInfoDto = PlayerCache.gameLotteryHttpOperation.enter(PlayerCache.loginInfo.uid); AudioManager.Instance.PlaySound("button"); if (lotteryRoomInfoDto != null) { TTLResponse(lotteryRoomInfoDto); } }
/// <summary> /// 进入房间,更新信息 /// </summary> /// <param name="info"></param> public void InRoom(LotteryRoomInfoDto info) { //if (info.residueTime > 10) //{ // StartTimeDown(info.residueTime - 10); //} //else if (info.residueTime >= 7) //{ // stopBet.gameObject.SetActive(true); // AHEndTxt.gameObject.SetActive(false); //} //else //{ // stopBet.gameObject.SetActive(false); // AHEndTxt.gameObject.SetActive(true); //} //if (info.historyDtos != null) //{ // lastTimeGrantAward.text = NumberConvert.ConvertW(info.lastTimeGrantAward); // playerNum.text = info.playerNum + "人"; // NowBetMoney.text = NumberConvert.ConvertW(info.nowBetMoney); // if (info.historyDtos.Count > 0) // { // LastResult.text = GameTools.GetCardType(info.historyDtos[0].result) + " " + GameTools.GetDoubleOrSingle(info.historyDtos[0].oddEnven); // } // PlayerCache.historyList.Clear(); // for (int i = 0; i < info.historyDtos.Count; i++) // { // AHResult AHResultItem = new AHResult(); // AHResultItem.OddEnven = info.historyDtos[i].oddEnven; // AHResultItem.Result = info.historyDtos[i].result; // PlayerCache.historyList.Add(AHResultItem); // } // HandleHistory(PlayerCache.historyList); //} if (info.residueTime > 10) { StartTimeDown(info.residueTime - 10); } else if (info.residueTime >= 7) { stopBet.gameObject.SetActive(true); AHEndTxt.gameObject.SetActive(false); } else { stopBet.gameObject.SetActive(false); AHEndTxt.gameObject.SetActive(true); } lastTimeGrantAward.text = NumberConvert.ConvertW(info.lastTimeGrantAward); playerNum.text = info.playerNum + "人"; NowBetMoney.text = NumberConvert.ConvertW(info.nowBetMoney); if (info.historyDtos != null) { LastResult.text = GameTools.GetCardType(info.historyDtos.result); } }