Beispiel #1
0
    /// <summary>
    /// 碰牌
    /// </summary>
    public void Peng_S()
    {
        //碰按钮
        GameObject.Find("Main Camera").GetComponent <FICStartGame>().pengButtonGO.SetActive(false);
        //过按钮
        GameObject.Find("Main Camera").GetComponent <FICStartGame>().guoButtonGO.SetActive(false);
        //杠按钮
        GameObject.Find("Main Camera").GetComponent <FICStartGame>().gangButtonGO.SetActive(false);
        //胡按钮
        GameObject.Find("Main Camera").GetComponent <FICStartGame>().huButtonGO.SetActive(false);
        GameObject qipai = GameObject.Find("Main Camera");

        //qipai.GetComponent<FICpaipaipai>().SPengGangPai(GameInfo.pengInfo.Mj.PaiHS, PPTYPE.Peng);
        //碰牌区生成3张碰杠牌,并加入碰杠牌集合,并消除手牌中相应的牌
        myCards.PengPaiEntir(GameInfo.pengInfo.mj.PaiHS);
        //个人手牌,弃牌,碰牌的父物体
        GameObject game = myCards.shouPaiContainerTrans.gameObject;

        //弃牌区的最后一张牌删除
        qipai.GetComponent <FICpaipaipai>().DelQIpai(GameInfo.GetFW(GameInfo.pengInfo.fw));
        // 当缺一门的牌确定后,将非缺门牌遮罩,只显示缺门牌,并排序到最右侧1-39筒。41-79条,81-119万,最开始调用的一次,之后的用其他方法
        gameObject.GetComponent <FICMaskPai>().OnQueYiMenButtonClick(GameInfo.queType);
        //var sp = SendPeng.CreateBuilder().SetTypes(1)
        //      .SetState(1)
        //      .SetOpenid(GameInfo.OpenID)
        //      .SetRoomid(GameInfo.room_id)
        //      .SetFW(GameInfo.pengInfo.Fw)
        //      .SetMj(GameInfo.pengInfo.Mj).Build();
        //byte[] body = sp.ToByteArray();

        var sp = new SendPeng();

        sp.types  = 1;
        sp.state  = 1;
        sp.openid = GameInfo.OpenID;
        sp.roomid = GameInfo.room_id;
        sp.FW     = GameInfo.pengInfo.fw;
        sp.mj     = GameInfo.pengInfo.mj;
        byte[] body = ProtobufUtility.GetByteFromProtoBuf(sp);
        byte[] data = CreateHead.CreateMessage(CreateHead.CSXYNUM + 4001, body.Length, 0, body);
        //将碰的信息上传
        GameInfo.cs.Send(data);
        GameInfo.pengInfo      = null;
        GameInfo.huPaiInfo     = null;
        GameInfo.returnHByType = null;
        // 根据传过来的方位和方式显示,碰杠特效
        startGame.ShowDeskSkillsOnDirection(FW.South, PPTYPE.Peng);
    }
Beispiel #2
0
 public void PengPai(int fw, int pengFw, IList <MaJiang> mj)
 {
     if (GameInfo.FW == (int)fw)
     {
         startGame.myCards.PengPaiEntir(mj[0].PaiHS);
         startGame.managerPai.DelQIpai(GameInfo.GetFW(pengFw));
     }
     else
     {
         GameObject.Destroy(ReturnShouPaiFwList(fw).Find(w => w.GetComponent <MJ_SP>().HS == mj[0].PaiHS));
         ReturnShouPaiFwList(fw).RemoveAt(ReturnShouPaiFwList(fw).FindIndex(w => w.GetComponent <MJ_SP>().HS == mj[0].PaiHS));
         GameObject.Destroy(ReturnShouPaiFwList(fw).Find(w => w.GetComponent <MJ_SP>().HS == mj[0].PaiHS));
         ReturnShouPaiFwList(fw).RemoveAt(ReturnShouPaiFwList(fw).FindIndex(w => w.GetComponent <MJ_SP>().HS == mj[0].PaiHS));
         startGame.managerPai.PengGangPai(GameInfo.GetFW(fw), GameInfo.GetFW(pengFw), mj[0].PaiHS, PPTYPE.Peng, false);
         PBSortAllShouPai(ReturnShouPaiFwList(fw), fw);
     }
     if (GameInfo.speed != 0)
     {
         startGame.ShowDeskSkillsOnDirection(GameInfo.GetFW(fw), PPTYPE.Peng);
     }
 }
Beispiel #3
0
    /// <summary>
    /// 碰牌
    /// </summary>
    public void Peng_S()
    {
        GameObject.Find("Main Camera").GetComponent <FICStartGame>().pengButtonGO.SetActive(false);
        GameObject.Find("Main Camera").GetComponent <FICStartGame>().guoButtonGO.SetActive(false);
        GameObject.Find("Main Camera").GetComponent <FICStartGame>().gangButtonGO.SetActive(false);
        GameObject.Find("Main Camera").GetComponent <FICStartGame>().huButtonGO.SetActive(false);
        GameObject qipai = GameObject.Find("Main Camera");

        //qipai.GetComponent<FICpaipaipai>().SPengGangPai(GameInfo.pengInfo.Mj.PaiHS, PPTYPE.Peng);
        myCards.PengPaiEntir(GameInfo.pengInfo.mj.PaiHS);
        GameObject game = myCards.shouPaiContainerTrans.gameObject;


        qipai.GetComponent <FICpaipaipai>().DelQIpai(GameInfo.GetFW(GameInfo.pengInfo.fw));

        gameObject.GetComponent <FICMaskPai>().OnQueYiMenButtonClick(GameInfo.queType);
        //var sp = SendPeng.CreateBuilder().SetTypes(1)
        //      .SetState(1)
        //      .SetOpenid(GameInfo.OpenID)
        //      .SetRoomid(GameInfo.room_id)
        //      .SetFW(GameInfo.pengInfo.Fw)
        //      .SetMj(GameInfo.pengInfo.Mj).Build();
        //byte[] body = sp.ToByteArray();

        var sp = new SendPeng();

        sp.types  = 1;
        sp.state  = 1;
        sp.openid = GameInfo.OpenID;
        sp.roomid = GameInfo.room_id;
        sp.FW     = GameInfo.pengInfo.fw;
        sp.mj     = GameInfo.pengInfo.mj;
        byte[] body = ProtobufUtility.GetByteFromProtoBuf(sp);
        byte[] data = CreateHead.CreateMessage(CreateHead.CSXYNUM + 4001, body.Length, 0, body);
        GameInfo.cs.Send(data);
        GameInfo.pengInfo      = null;
        GameInfo.huPaiInfo     = null;
        GameInfo.returnHByType = null;
        startGame.ShowDeskSkillsOnDirection(FW.South, PPTYPE.Peng);
    }