コード例 #1
0
 /// <summary>
 /// 点击胡按钮
 /// </summary>
 private void onHuClick(PlayerActType act, int card)
 {
     if (act == PlayerActType.SELF_HU)
     {
         var actC2S = new ZiMoHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_ZI_MO_HU.GetHashCode(), 0, actC2S);
     }
     else if (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);
     }
     else if (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);
     }
     else if (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);
     }
     else if (act == PlayerActType.CHI_HU)
     {
         var actC2S = new ChiHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.C2S_ROOM_CHI_HU.GetHashCode(), 0, actC2S);
     }
 }
コード例 #2
0
ファイル: HeadItem.cs プロジェクト: CreatedWorld/jxjdz
 /// <summary>
 /// 点击胡按钮
 /// </summary>
 private void onHuClick(PlayerActType act, int card)
 {
     //Debug.Log("onHuClick ********************************");
     if (act == PlayerActType.SELF_HU)
     {
         var actC2S = new ZiMoHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.ZIMOHU_C2S.GetHashCode(), 0, actC2S);
     }
     else if (act == PlayerActType.QIANG_AN_GANG_HU)
     {
         var actC2S = new QiangAnGangHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.QIANGANGANGHU_C2S.GetHashCode(), 0, actC2S);
     }
     else if (act == PlayerActType.QIANG_PENG_GANG_HU)
     {
         var actC2S = new QiangPengGangHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.QIANGPENGGANGHU_C2S.GetHashCode(), 0, actC2S);
     }
     else if (act == PlayerActType.QIANG_ZHI_GANG_HU)
     {
         var actC2S = new QiangZhiGangHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.QIANGZHIGANGHU_C2S.GetHashCode(), 0, actC2S);
     }
     else if (act == PlayerActType.CHI_HU)
     {
         var actC2S = new ChiHuC2S();
         NetMgr.Instance.SendBuff(SocketType.BATTLE, MsgNoC2S.CHIHU_C2S.GetHashCode(), 0, actC2S);
     }
     for (int i = 0; i < actionBtns.Count; i++)
     {
         actionBtns[i].gameObject.SetActive(false);
     }
     for (int i = 0; i < actionBtns.Count; i++)
     {
         Debug.Log("childCount = " + actionBtns[i].gameObject.transform.childCount);
         for (int j = 0; j < actionBtns[i].gameObject.transform.childCount; j++)
         {
             Destroy(actionBtns[i].gameObject.transform.GetChild(j).gameObject);
         }
     }
 }
コード例 #3
0
ファイル: ClientAIMgr.cs プロジェクト: vinhphu3000/client
 /// <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;
     }
 }