//开关微信邀请好友 void SwitchViewShare(NN_ENUM_ROOM_STATUS roomStatus, NiuNiu.Seat PlayerSeat, int loop) { if (!SystemProxy.Instance.IsInstallWeChat || !SystemProxy.Instance.IsOpenWXLogin) { _ViewShareClickBtn.gameObject.SetActive(false); return; } #if IS_CANGZHOU if (loop > 0) { _ViewShareClickBtn.gameObject.SetActive(false); return; } #endif if (roomStatus == NN_ENUM_ROOM_STATUS.IDLE && PlayerSeat.IsBanker) { if (!_ViewShareClickBtn.gameObject.activeSelf) { _ViewShareClickBtn.gameObject.SetActive(true); NiuNiuWindWordAni.PopUp(_ViewShareClickBtn); } } else { if (_ViewShareClickBtn.gameObject.activeSelf) { _ViewShareClickBtn.gameObject.SetActive(false); } } }
//详细信息动画 IEnumerator ConclusionAni() { yield return(new WaitForSeconds(1f)); _ContentBG.SetActive(true); NiuNiuWindWordAni.PopUp(_ContentBG.transform); }
//开关非庄家抢庄按钮+不抢按钮 public void SwitchNoBankerBtnParentBtn(bool onOff) { if (_NoBankerBtnParent.gameObject.activeSelf != onOff) { _NoBankerBtnParent.gameObject.SetActive(onOff); if (onOff) { NiuNiuWindWordAni.PopUp(_NoBankerBtnParent); } } }
//成功失败动画 void VictoryFailureAni(NiuNiu.Seat seat) { if (seat.Earnings >= 0) { _VictoryFailureAni[0].SetActive(true); NiuNiuWindWordAni.PopUp(_VictoryFailureAni[0].transform); } if (seat.Earnings < 0) { _VictoryFailureAni[1].SetActive(true); NiuNiuWindWordAni.PopUp(_VictoryFailureAni[1].transform); } }
/// <summary> /// 开关开牌按钮 (现为开自己牌) /// </summary> /// <param name="roomStatus"></param> public void SwitchOpenPokerBtn(Room room) { Seat player = null; for (int i = 0; i < room.SeatList.Count; ++i) { if (room.SeatList[i].PlayerId > 0 && room.SeatList[i].Index == 0) { player = room.SeatList[i]; break; } } //自己牌是否全开 bool isPokerAllShow = true; for (int i = 0; i < player.PokerList.Count; i++) { if (player.PokerList[i].index != 0 && player.PokerList[i].status != NN_ENUM_POKER_STATUS.POKER_STATUS_UPWARD) { isPokerAllShow = false; } } if (!isPokerAllShow && (room.roomStatus == NN_ENUM_ROOM_STATUS.LOOKPOCKER || (room.superModel == Room.SuperModel.PassionRoom && room.roomStatus == NN_ENUM_ROOM_STATUS.POUR && player != null && player.Pour > 0))) { if (_OpenPokerBtn.gameObject.activeSelf == false) { _OpenPokerBtn.gameObject.SetActive(true); NiuNiuWindWordAni.PopUp(_OpenPokerBtn); if (_RubPokerBtn != null && room.superModel == Room.SuperModel.PassionRoom) { _RubPokerBtn.gameObject.SetActive(true); NiuNiuWindWordAni.PopUp(_RubPokerBtn); } return; } } else { _OpenPokerBtn.gameObject.SetActive(false); if (_RubPokerBtn != null) { _RubPokerBtn.gameObject.SetActive(false); } } }
/// <summary> /// 处理开关 换庄系列(换庄 抢庄等) /// </summary> /// <param name="seat"></param> /// <param name="room"></param> public void SwitchDecisionBnaker(NiuNiu.Seat seat, NiuNiu.Room room, int playerNumber) { NN_ENUM_ROOM_STATUS roomStatus = room.roomStatus; bool currActiveSelfBankerBtn = _BankerBtnParent.gameObject.activeSelf; bool currActiveSelfNoBankerBtn = _NoBankerBtnParent.gameObject.activeSelf; Debug.Log(string.Format("处理开关换庄按钮 房间状态:{0},自己ID:{1},庄:{2}", roomStatus.ToString(), seat.PlayerId, seat.IsBanker)); if (roomStatus == NN_ENUM_ROOM_STATUS.IDLE || roomStatus == NN_ENUM_ROOM_STATUS.DISSOLVE) { //庄 if (seat.IsBanker && playerNumber >= 2) { if (currActiveSelfBankerBtn == false) { _BankerBtnParent.gameObject.SetActive(true); NiuNiuWindWordAni.PopUp(_BankerBtnParent); } } else { _BankerBtnParent.gameObject.SetActive(false); } //非庄 //if (!seat.IsBanker && currActiveSelfBankerBtn == true) //{ _NoBankerBtnParent.gameObject.SetActive(false); //} } else if (roomStatus == NN_ENUM_ROOM_STATUS.HOG) { _BankerBtnParent.gameObject.SetActive(false); if (room.roomModel == Room.RoomModel.robBanker) { _NoBankerBtnParent.gameObject.SetActive(seat.isAlreadyHOG == 0 && seat.PokerList[0].index > 0); if (seat.isAlreadyHOG == 0 && seat.PokerList[0].index > 0 && currActiveSelfNoBankerBtn == false) { NiuNiuWindWordAni.PopUp(_NoBankerBtnParent); } } else if (room.roomModel == Room.RoomModel.AbdicateBanker) { _NoBankerBtnParent.gameObject.SetActive(!seat.IsBanker && seat.isAlreadyHOG == 0); if (!seat.IsBanker && seat.isAlreadyHOG == 0 && currActiveSelfNoBankerBtn == false) { NiuNiuWindWordAni.PopUp(_NoBankerBtnParent); } } } else { if (currActiveSelfBankerBtn) { _BankerBtnParent.gameObject.SetActive(false); } if (currActiveSelfNoBankerBtn) { _NoBankerBtnParent.gameObject.SetActive(false); } return; } }