//历史记录 public override void history2CallBack(DiceHistoryDto callBackParam) { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); //历史记录显示 diceGameMove.HistoryShow(callBackParam); }
//触摸反馈页面按钮事件 private void TouchOnclick() { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); rankingPanel.gameObject.SetActive(false); diceGameMove.IRPanelClose(); diceGameMove.SettBackBtnOnclick(); TouchPanel.gameObject.SetActive(false); }
//清除下注 public override void clearBet2CallBack(GameDiceBetUpdateWeathDto callBackParam) { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); //及时更改财富 PlayerCache.loginInfo.gold = callBackParam.residueGold; //清除成功方法 diceGameMove.ClearBetSucc(callBackParam.residueGold); }
//结算排行 public override void settleAccountRanking(int count1, int count2, DiceSettleRankingListDto dto) { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); Diceliuliu.diceSettleRanking = dto; Diceliuliu.diceSettleCount[0] = count1; Diceliuliu.diceSettleCount[1] = count2; //调用点数显示 diceGameMove.Countshow(); }
//开始 public override void start() { UIDicePlane uIDicePlane = MessageManager.GetInstance.GetUIDict <UIDicePlane>(); DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); //记录自己的财富 uIDicePlane.SelfWeathinfo(); //倒计时开始 diceGameMove.CountdownMove1(25); uIDicePlane.BetChipBool(true); }
//返回大厅 public override void exitRoom2CallBack(bool callBackParam) { UIDicePlane uIDicePlane = MessageManager.GetInstance.GetUIDict <UIDicePlane>(); DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); uIDicePlane.BackGameboj(); diceGameMove.BackGameboj(); UIManager.Instance.Clear(); PlayerCache.SeatPlayerinfoDic.Clear(); SceneManager.LoadScene((int)SceneType.Hall); }
//别人清空下注 public void PlayerClearBet(long uid, long residueGold, long roomAllGold, int nowBetCount) { //是不是座位玩家 if (PlayerCache.SeatPlayerinfoDic.ContainsKey(uid)) { PlayerCache.SeatPlayerinfoDic.TryGetValue(uid, out GameDicePositionPlayerInfoDto value); SeatList[value.position].transform.GetChild(0).GetChild(2).GetComponent <Text>().text = NumberConvert.ConvertW(residueGold); } DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); diceGameMove.Betpeoplenum_RentalMove1(roomAllGold, nowBetCount); }
public override void OnStart() { if (GameManager.Instance.diceRoomInfiDto != null) { PlayerCache.CurrentSceneID = SceneID.Dice; DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); if (diceGameMove != null) { IsBack = true; diceGameMove.InitialInfo(GameManager.Instance.diceRoomInfiDto); } } }
//下注成功返回事件 public override void bet2CallBack(GameDiceBetUpdateWeathDto callBackParam) { if (callBackParam != null) { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); UIDicePlane UIDicePlane = MessageManager.GetInstance.GetUIDict <UIDicePlane>(); //及时更改自己的财富 PlayerCache.loginInfo.gold = callBackParam.residueGold; //自己投注金额及财富变更改变 diceGameMove.SelfBetGoldCount(callBackParam); UIDicePlane.BetSucceed(callBackParam); } }
//游戏结算自己财富变化 public void SelfWeathChange(DiceSettleRankingDto d) { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); //财富变更 diceGameMove.Selfweathnum = d.winGold; IsBack = true; tempgold = NumberConvert.ConvertW(d.residueGold); //如果在座位中 if (PlayerCache.SeatPlayerinfoDic.ContainsKey(d.uid)) { PlayerCache.SeatPlayerinfoDic.TryGetValue(d.uid, out GameDicePositionPlayerInfoDto value); SeatList[value.position].transform.GetChild(0).GetChild(2).GetComponent <Text>().text = tempgold; } PlayerGoldCount.text = tempgold.ToString(); }
//获取自己人物信息 public void GainPlayer() { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); diceGameMove.betGoldcount.text = "0"; PlayerName.text = PlayerCache.loginInfo.userName; LoadHeadImgUtils.Instance.LoadHeadImg(PlayerIma, PlayerCache.loginInfo.headImgUrl); PlayerGoldCount.text = PlayerCache.loginInfo.gold.ToString(); if (PlayerCache.loginInfo.vipLv > 0) { VIPbiao.sprite = VIPImages[PlayerCache.loginInfo.vipLv - 1]; } else { VIPbiao.gameObject.SetActive(false); } }
//清理一切 public void Clear() { //所有筹码隐藏 for (int i = 0; i < BetChipPos.childCount; i++) { BetChipPos.GetChild(i).gameObject.SetActive(false); } DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); //清除奖项信息 for (int i = 0; i < diceGameMove.ResultShow.childCount; i++) { Destroy(diceGameMove.ResultShow.GetChild(i).gameObject); } diceGameMove.Betpeoplenum_RentalMove1(0, 0); //自己投注金额归零 diceGameMove.betGoldcount.text = "0"; //结算页面隐藏 diceGameMove.SettBackBtnOnclick(); tempbetChange = 0; tempbetup = 0; }
////别人投注事件 public void OtherPlayerBet(long uid, long holdGold, int betGold, int betPosition, int betNum, long roomAllGold) { AudioManager.Instance.PlaySound("selfbet"); if (uid != PlayerCache.loginInfo.uid) { //如果该账号在有座位字典中 if (PlayerCache.SeatPlayerinfoDic.ContainsKey(uid)) { PlayerCache.SeatPlayerinfoDic.TryGetValue(uid, out GameDicePositionPlayerInfoDto value); for (int i = 0; i < ChipValueList.Length; i++) { //根据金币数量生成筹码 if (ChipValueList[i] == betGold) { if (BetChipPos.childCount != 0) { for (int j = 0; j < BetChipPos.childCount; j++) { GameObject obj = BetChipPos.GetChild(j).gameObject; if (obj.activeSelf == false) { //更换图片 obj.GetComponent <Image>().sprite = BetSpriteList[i]; //移动到这个位置 Tweener tweener = obj.GetComponent <Image>().transform.DOLocalMove (new Vector3(Random.Range(PostionModelList[betPosition - 1].XX, PostionModelList[betPosition - 1].DX), Random.Range(PostionModelList[betPosition - 1].XY, PostionModelList[betPosition - 1].DY), 0), 0.01f); obj.SetActive(true); break; }//说明是最后一个 else if (j == BetChipPos.childCount - 1) { if (j >= 200) { for (int x = 0; x < 190; x++) { int y = Random.Range(0, 190); if (BetChipPos.GetChild(y).gameObject.activeSelf) { BetChipPos.GetChild(y).gameObject.SetActive(false); } else { break; } } } //重新生成 GameObject clone = Instantiate(BetChip, BetChipPos); //更换图片 clone.GetComponent <Image>().sprite = BetSpriteList[i]; //移动到这个位置 Tweener tweener = clone.GetComponent <Image>().transform.DOLocalMove (new Vector3(Random.Range(PostionModelList[betPosition - 1].XX, PostionModelList[betPosition - 1].DX), Random.Range(PostionModelList[betPosition - 1].XY, PostionModelList[betPosition - 1].DY), 0), 0.01f); break; } } } else { //重新生成 GameObject obj = Instantiate(BetChip, BetChipPos); //更换图片 obj.GetComponent <Image>().sprite = BetSpriteList[i]; //移动到这个位置 Tweener tweener = obj.GetComponent <Image>().transform.DOLocalMove (new Vector3(Random.Range(PostionModelList[betPosition - 1].XX, PostionModelList[betPosition - 1].DX), Random.Range(PostionModelList[betPosition - 1].XY, PostionModelList[betPosition - 1].DY), 0), 0.01f); } } } //更改座位上的财富值 SeatList[value.position].transform.GetChild(0).GetChild(2).GetComponent <Text>().text = NumberConvert.ConvertW(holdGold); } else { for (int i = 0; i < ChipValueList.Length; i++) { //根据金币数量生成筹码 if (ChipValueList[i] == betGold) { if (BetChipPos.childCount != 0) { for (int j = 0; j < BetChipPos.childCount; j++) { GameObject obj = BetChipPos.GetChild(j).gameObject; if (obj.activeSelf == false) { //更换图片 obj.GetComponent <Image>().sprite = BetSpriteList[i]; //移动到这个位置 Tweener tweener = obj.transform.DOLocalMove (new Vector3(Random.Range(PostionModelList[betPosition - 1].XX, PostionModelList[betPosition - 1].DX), Random.Range(PostionModelList[betPosition - 1].XY, PostionModelList[betPosition - 1].DY), 0), 0.01f); obj.SetActive(true); break; }//说明是最后一个 else if (j == BetChipPos.childCount - 1) { //重新生成 GameObject clone = Instantiate(BetChip, BetChipPos); //更换图片 clone.GetComponent <Image>().sprite = BetSpriteList[i]; //移动到这个位置 Tweener tweener = clone.transform.DOLocalMove (new Vector3(Random.Range(PostionModelList[betPosition - 1].XX, PostionModelList[betPosition - 1].DX), Random.Range(PostionModelList[betPosition - 1].XY, PostionModelList[betPosition - 1].DY), 0), 0.01f); break; } } } else { //重新生成 GameObject obj = Instantiate(BetChip, BetChipPos); //更换图片 obj.GetComponent <Image>().sprite = BetSpriteList[i]; //移动到这个位置 obj.transform.localPosition = PlayerIma.transform.localPosition; Tweener tweener = obj.transform.DOLocalMove (new Vector3(Random.Range(PostionModelList[betPosition - 1].XX, PostionModelList[betPosition - 1].DX), Random.Range(PostionModelList[betPosition - 1].XY, PostionModelList[betPosition - 1].DY), 0), 0.01f); } } } } } DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); diceGameMove.Betpeoplenum_RentalMove1(roomAllGold, betNum); }
//被踢下座位 public override void kicking(string selfUserName, string targetUserName, long targetUid) { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); diceGameMove.Beingkicked(targetUserName); }
//停止投注 public override void stopBet() { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); diceGameMove.StopBet(); }
//所有无座玩家 public override void nowPlayPlayerList2CallBack(GameDicePositionPlayerInfoListDto callBackParam) { DiceGameMove diceGameMove = MessageManager.GetInstance.GetUIDict <DiceGameMove>(); diceGameMove.OtherinfoShow(callBackParam); }