private void CutPokerAni() { SeatEntity seat = GetIsBanke(); if (seat != null) { GuPaiJiuSeatCtrl currSeatCrtl = GetSeatCtrlBySeatPos(seat.Index); if (currSeatCrtl != null) { int dun = CutPokerAniQueue.Dequeue(); //动画结束事件?? Debug.Log(dun + " ````````````````````````````````````````````````开始切牌动画"); currSeatCrtl.CutPokerAni(dun, () => { if (CutPokerAniQueue.Count > 0) { CutPokerAni(); } else { isCutPokerBig = false; OnCutPokerEnd(); //SendCurPokerEnd();//客户端发送切牌结束 return; } }); } } }
IEnumerator PlayMusicTor(RoomEntity room, SeatEntity currentSeat) { List <string> MusiList = new List <string>(); int currentPos = currentSeat.Pos; for (int j = 0; j < room.seatList.Count; ++j) { if (MusiList.Count != 0) { MusiList.Clear(); } int seatIndex = (currentPos + j - 1) % room.seatList.Count; SeatEntity seat = room.seatList[seatIndex]; if (seat.PlayerId == 0) { continue; } GuPaiJiuSeatCtrl currSeatCrtl = GetSeatCtrlBySeatPos(seat.Index); MusiList = currSeatCrtl.PlayMusic(seat); for (int i = 0; i < MusiList.Count; i++) { string MusicName = string.Format("gp_{0}_{1}", MusiList[i], seat.Gender); AudioEffectManager.Instance.Play(MusicName, Vector3.zero); yield return(new WaitForSeconds(0.5f)); } yield return(new WaitForSeconds(0.3f)); } }
/// <summary> /// 组合牌结束 /// </summary> /// <param name="data"></param> private void GroupEnd(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); bool IsPlayer = data.GetValue <bool>("IsPlayer"); GuPaiJiuSeatCtrl currSeatCrtl = GetSeatCtrlBySeatPos(seat.Index); currSeatCrtl.SeatCtrlGroupEnd(seat, roomStatus); }
/// <summary> /// 发牌动画 /// </summary> private void BigDealAni(TransferData data) { RoomEntity room = data.GetValue <RoomEntity>("Room"); for (int i = 0; i < room.seatList.Count; i++) { if (room.seatList[i].IsBanker) { GuPaiJiuSeatCtrl seatCtrl = GetSeatCtrlBySeatPos(room.seatList[i].Index); StartCoroutine(DealAniTor(seatCtrl, room)); } } }
IEnumerator GroupEndJieSuanPoker(int currentPos, RoomEntity room, List <SeatEntity> seatList) { for (int j = 0; j < 4; ++j) { int seatIndex = (currentPos + j - 1) % room.seatList.Count; SeatEntity seat = room.seatList[seatIndex]; GuPaiJiuSeatCtrl currSeatCrtl = GetSeatCtrlBySeatPos(seat.Index); currSeatCrtl.SetCtrlJieSuanPoker(seat, room.roomStatus); yield return(new WaitForSeconds(2f)); } yield return(new WaitForSeconds(0.5f)); RoomGuPaiJiuProxy.Instance.SetBetUI(seatList); }
/// <summary> /// 洗牌动画 /// </summary> private void ShuffleAnimation(TransferData data) { Debug.Log("······················开始洗牌啦························"); RoomEntity room = data.GetValue <RoomEntity>("Room"); for (int i = 0; i < room.seatList.Count; i++) { if (room.seatList[i].IsBanker) { GuPaiJiuSeatCtrl seatCtrl = GetSeatCtrlBySeatPos(room.seatList[i].Index); Debug.Log(seatCtrl.SeatIndex + " 洗牌Index"); //BankerSeat = room.seatList[i]; //if (wallList.Count != 0) wallList.Clear(); seatCtrl.ShuffleAnimation(room, (List <GameObject> listObj) => { //this.wallList = listObj; }); AudioEffectManager.Instance.Play("gp_xipai", Vector3.zero); } } }
IEnumerator DealAniTor(GuPaiJiuSeatCtrl seatCtrl, RoomEntity room) { Debug.Log("```````````````````````````````````````开始发牌``````````````````````````````````````````````````````" + room.FirstGivePos); int loopCount = room.roomPlay == EnumPlay.BigPaiJiu ? 4 : 2; //int loopCount = 31; int firstGivePos = room.FirstGivePos; //按顺序发牌 for (int j = 0; j < room.seatList.Count; ++j) { int seatIndex = (firstGivePos + j - 1) % room.seatList.Count; SeatEntity seat = room.seatList[seatIndex]; GuPaiJiuSeatCtrl currSeatCrtl = GetSeatCtrlBySeatPos(seat.Index); for (int i = 0; i < loopCount; i++) { if (i < 2) { seatCtrl.DealTran.transform.GetChild(seatCtrl.DealTran.transform.childCount - i - 1).DOMove(currSeatCrtl.HandContainer[2].position, 0.5f); } else { seatCtrl.DealTran.transform.GetChild(seatCtrl.DealTran.transform.childCount - i - 1).DOMove(currSeatCrtl.HandContainer[2].position + new Vector3(39, 0, 0), 0.5f); } } yield return(new WaitForSeconds(0.2f)); for (int k = 0; k < loopCount; k++) { Destroy(seatCtrl.DealTran.transform.GetChild(seatCtrl.DealTran.transform.childCount - k - 1).gameObject); LoadPoker(seat, currSeatCrtl.HandContainer[k], k); } AudioEffectManager.Instance.Play("gp_fapai", Vector3.zero); yield return(new WaitForSeconds(0.2f)); } yield return(new WaitForSeconds(0.1f)); SendNotification(ConstantGuPaiJiu.GuPaiJiuClientEmptyReceive); }
private void StartCutPoker1(TransferData data) { GameObject go = data.GetValue <GameObject>("Obj"); SeatEntity seat = GetIsBanke(); if (seat != null) { GuPaiJiuSeatCtrl currSeatCrtl = GetSeatCtrlBySeatPos(seat.Index); if (curRoomStatus == ROOM_STATUS.CUTPOKER && isPlayCutPokerAni && !isCutPokerBig) { for (int i = 0; i < currSeatCrtl.pokerWall.Count; i++) { if (go == currSeatCrtl.pokerWall[i]) { int index = go.transform.GetSiblingIndex(); Debug.Log(index + " ······ ······· 切牌顿数"); GuPaiJiuGameCtrl.Instance.OnGuPaiJiuClientSendCutPokerInfo(index / 2); break; } } } } }