Exemple #1
0
    void startGame(ClientResponse response)
    {
        GlobalDataScript.roomAvatarVoList = avatarList;
        print(" startGame " + avatarList.Count);
        StartGameVO sgvo = JsonMapper.ToObject <StartGameVO>(response.message);

        cleanGameplayUI();
        //cleanDesk_dzpk();  清理十三水扑克桌面    TODO
        GlobalDataScript.surplusTimes--;
        if (GlobalDataScript.goldType)
        {
            gameNumber.text = GlobalDataScript.playCountForGoldType + "";
        }
        else
        {
            gameNumber.text = GlobalDataScript.surplusTimes + "/" + GlobalDataScript.roomVo.roundNumber;
        }

        bankerId = sgvo.bankerId;
        avatarList[bankerId].main = true;
        PlayerItemScript bankerItem = getPlayItem(bankerId);

        bankerItem.setbankImgEnable(true);

        GlobalDataScript.finalGameEndVo = null;
        initArrayList();

        isFirstOpen = false;
        GlobalDataScript.isOverByPlayer = false;
        int selfIndex = getMyIndexFromList();

        mineList = sgvo.paiArray;
        setAllPlayerReadImgVisbleToFalse();

        //所有玩家发牌移动动画          动画可不要
        float time = 0;

        if (GlobalDataScript.roomVo.AA == false)   //德扑发两张牌
        {
            for (int i = 0; i < 13; i++)
            {
                for (int j = 0; j < avatarList.Count; j++)
                {
                    if (avatarList[j].scores > GlobalDataScript.roomVo.initFen_dzpk / 100)
                    {
                        int seat = getIndexByDir(getDirection(j));
                        StartCoroutine(DisplayFaPaiMove(seat, time, i));
                        time += 0.4f;
                    }
                }
            }
        }
    }
Exemple #2
0
    private void OnSubGameStart(byte[] tmpBuf, int size)
    {
        var pGameStart = NetUtil.BytesToStruct <CMD_S_GameStart>(tmpBuf);
        var list       = new int[34];
        var sgv        = new StartGameVO
        {
            //bankerId = pGameStart.wCurrentUser
        };
        int cardID;

        for (int i = 0; i < 14; i++)
        {
            // cardID = MaJiangHelper.MaJiangCardChange((MJ_PAI)pGameStart.cbCardData[i]);
            //if (cardID < 0 || cardID > 34)
            //    continue;
            //list[cardID]++;
        }

        sgv.paiArray = new List <int>(list);
        SetClientResponse(APIS.STARTGAME_RESPONSE_NOTICE, NetUtil.ObjToJson(sgv));
    }