コード例 #1
0
    /// <summary>
    /// 推送结算
    /// </summary>
    public static void G2C_Result(DdzJieSuanResp result)
    {
        LandlordsModel.Instance.IsInFight = false;
        DdzJieSuanInfo juesuanInfo = result.jieSuanInfo;

        //yield return new WaitForSecondsRealtime(0.1f);
        LandlordsModel.Instance.ResultModel.zd  = result.jieSuanInfo.zdbs;
        LandlordsModel.Instance.ResultModel.jdz = result.jieSuanInfo.dzbs;
        LandlordsModel.Instance.ResultModel.ct  = result.jieSuanInfo.ct ? 2 : 0;
        LandlordsModel.Instance.ResultModel.fct = result.jieSuanInfo.fc ? 2 : 0;
        for (int i = 0; i < juesuanInfo.playerInfo.Count; i++)
        {
            DdzJSPlayerInfo playerIcom = juesuanInfo.playerInfo[i];
            LandlordsModel.Instance.ResultModel.Add(playerIcom);
            if (playerIcom.income > 0)
            {
                LandlordsModel.Instance.CurWinerIds.Add(playerIcom.userId);
            }

            if (LandlordsModel.Instance.RoomModel.CurRoomInfo.IsMatch)
            {
                LandlordsModel.Instance.RoomPlayerHands.Find(p => p.playerInfo.uid == juesuanInfo.playerInfo[i].userId.ToString()).MatchScore += juesuanInfo.playerInfo[i].income;
            }
            else if (LandlordsModel.Instance.RoomModel.CurRoomInfo.RoomType == RoomType.RoomCard)
            {
                LandlordsModel.Instance.RoomPlayerHands.Find(p => p.playerInfo.uid == juesuanInfo.playerInfo[i].userId.ToString()).playerInfo.score += juesuanInfo.playerInfo[i].income;
            }
            else
            {
                LandlordsModel.Instance.RoomPlayerHands.Find(p => p.playerInfo.uid == juesuanInfo.playerInfo[i].userId.ToString()).playerInfo.money = juesuanInfo.playerInfo[i].coin;
            }
        }
        LandlordsModel.Instance.ResultModel.curJs = result.jieSuanInfo.currJs;
        LandlordsModel.Instance.ResultModel.allJs = result.jieSuanInfo.totalJs;

        float delay = 0;

        if (LandlordsModel.Instance.RoomModel.CurRoomInfo.RoomType != RoomType.Match)
        {
            delay = 1.5f;
        }
        else
        {
            delay = 0;
        }
        SetTimeout.add(delay, () =>
        {
            CheckIsChuntianOrReverse(juesuanInfo);
            //总显示
            LandlordsPage.Instance.GameOver();
        });
    }
コード例 #2
0
    public Text curResultLb; //这次的成绩

    public void Init(DdzJSPlayerInfo info)
    {
        StartCoroutine(MiscUtils.DownloadImage(info.photo, spr =>
        {
            headIcon.sprite = spr;
        }));
        if (identyIcon)
        {
            if (info.isDz)
            {
                identyIcon.sprite = BundleManager.Instance.GetSprite("doudizhu_icon_dizhu2", LandlordsPage.Instance.GetSpriteAB());
            }
            else
            {
                identyIcon.sprite = BundleManager.Instance.GetSprite("doudizhu_icon_nongmin", LandlordsPage.Instance.GetSpriteAB());
            }
        }
        if (info.userId == UserInfoModel.userInfo.userId)
        {
            nameLb.color = new Color(248 / 255f, 228 / 255f, 178 / 255f);
        }
        else
        {
            nameLb.color = new Color(193 / 255f, 95 / 255f, 36 / 255f);
        }
        nameLb.text      = info.nickname.ToString();
        AllresultLb.text = info.totalIncome > 0 ? "+" + info.totalIncome : info.totalIncome.ToString();
        curResultLb.text = info.income > 0 ? "+" + info.income : info.income.ToString();
        if (isMe_name)
        {
            isMe_name.SetActive(info.userId == UserInfoModel.userInfo.userId);
        }
        if (isMe_mask)
        {
            isMe_mask.SetActive(info.userId == UserInfoModel.userInfo.userId);
        }
        if (isWinObj)
        {
            isWinObj.SetActive(info.totalIncome > 0);
        }
    }
コード例 #3
0
 public int allJs; //总局数
 /// <summary>
 /// 添加结算信息
 /// </summary>
 public void Add(DdzJSPlayerInfo info)
 {
     resultInfos.Add(info);
 }