Exemplo n.º 1
0
 /// <summary>
 /// 点击碰杠按钮
 /// </summary>
 private void onPengGangClick(PlayerActType act, int card)
 {
     if (act == PlayerActType.COMMON_PENG_GANG)
     {
         var actC2S = new CommonPengGangC2S();
         actC2S.mahjongCode = card;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_COMMON_PENG_GANG.GetHashCode(), 0, actC2S);
     }
     else if (act == PlayerActType.BACK_PENG_GANG)
     {
         var actC2S = new BackPengGangC2S();
         actC2S.mahjongCode = card;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_BACK_PENG_GANG.GetHashCode(), 0, actC2S);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 点击碰杠按钮
 /// </summary>
 private void onPengGangClick(PlayerActType act, int card)
 {
     if (act == PlayerActType.COMMON_PENG_GANG)
     {
         var actC2S = new CommonPengGangC2S();
         actC2S.mahjongCode = card;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.COMMONPENGGANG_C2S.GetHashCode(), 0, actC2S);
     }
     else if (act == PlayerActType.BACK_PENG_GANG)
     {
         var actC2S = new BackPengGangC2S();
         actC2S.mahjongCode = card;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.BACKPENGGANG_C2S.GetHashCode(), 0, actC2S);
     }
     for (int i = 0; i < actionBtns.Count; i++)
     {
         for (int j = 0; j < actionBtns[i].gameObject.transform.childCount; j++)
         {
             Destroy(actionBtns[i].gameObject.transform.GetChild(j).gameObject);
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 第一操作响应
 /// </summary>
 /// <param name="actPowerVO"></param>
 private void FirstActHandler(ActPowerVO actPowerVO)
 {
     if (actPowerVO.act == PlayerActType.PASS)
     {
         var actC2S = new GuoC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_PASS.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.PENG)
     {
         var actC2S = new PengC2S();
         actC2S.mahjongCode = actPowerVO.actCard;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_PENG.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.CHI)
     {
         var actC2S = new ChiC2S();
         actC2S.mahjongCodes.AddRange(chiPowerArr[0].chiCards);
         actC2S.mahjongCodes.Add(chiPowerArr[0].chiCard);
         actC2S.forbitCards.AddRange(chiPowerArr[0].forbitCards);
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_PENG.GetHashCode(), 0, actC2S);
     }
     else if (actPowerVO.act == PlayerActType.SELF_HU)
     {
         var actC2S = new ZiMoHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_ZI_MO_HU.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.QIANG_AN_GANG_HU)
     {
         var actC2S = new QiangAnGangHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_QIANG_AN_GANG_HU.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.QIANG_PENG_GANG_HU)
     {
         var actC2S = new QiangPengGangHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_QIANG_PENG_GANG_HU.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.QIANG_ZHI_GANG_HU)
     {
         var actC2S = new QiangZhiGangHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_QIANG_ZHI_GANG_HU.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.CHI_HU)
     {
         var actC2S = new ChiHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_CHI_HU.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.COMMON_AN_GANG)
     {
         var actC2S = new CommonAnGangC2S();
         actC2S.mahjongCode = actPowerVO.actCard;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_COMMON_AN_GANG.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.BACK_AN_GANG)
     {
         var actC2S = new BackAnGangC2S();
         actC2S.mahjongCode = actPowerVO.actCard;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_BACK_AN_GANG.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.ZHI_GANG)
     {
         var actC2S = new ZhiGangC2S();
         actC2S.mahjongCode = actPowerVO.actCard;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_ZHI_GANG.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.COMMON_PENG_GANG)
     {
         var actC2S = new CommonPengGangC2S();
         actC2S.mahjongCode = actPowerVO.actCard;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_COMMON_PENG_GANG.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
     else if (actPowerVO.act == PlayerActType.BACK_PENG_GANG)
     {
         var actC2S = new BackPengGangC2S();
         actC2S.mahjongCode = actPowerVO.actCard;
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_BACK_PENG_GANG.GetHashCode(), 0, actC2S);
         chiPowerArr = null;
     }
 }