Beispiel #1
0
    /// <summary>
    /// 同步小结算
    /// </summary>
    /// <param name="data"></param>
    private IEnumerator OnSmallSettle(TenonSmallSettle data)
    {
        List <int> winList  = new List <int>();
        List <int> loseList = new List <int>();

        yield return(new WaitForSeconds(1.5f));

        FlySmallSettleCoin(data.winList);

        yield return(new WaitForSeconds(1.0f));

        FlySmallSettleCoin(data.lostList);

        TenPlayerUI player = null;

        if (data.scoreList != null)
        {
            for (int i = 0; i < data.scoreList.Count; i++)
            {
                if (TryGetPlayer(data.scoreList[i].seatId, out player))
                {
                    player.SetWinLoseScore(data.scoreList[i].score);
                }
            }
        }

        if (data.lastScore != null)
        {
            for (int i = 0; i < data.lastScore.Count; i++)
            {
                UpdatePlayerScore(data.lastScore[i].seatId, data.lastScore[i].score);
                if (data.lastScore[i].seatId == TenModel.Inst.mMySeatId)
                {
                    UpdateTotalWinScore(data.lastScore[i].totalWin);
                }
            }
        }

        DelayRun(5.0f, () => {
            mSelfPlayer.SetReadybtnState(true);
            if (TenModel.Inst.mGoldPattern)
            {
                mSelfPlayer.SetChangDeskBtnState(true);
            }
            else
            {
                mSelfPlayer.SetChangDeskBtnState(false);
            }
            CleanDesk();
        });
    }