示例#1
0
        public override void SetResultItem(Sfs2X.Entities.Data.ISFSObject user, YxBaseUserInfo userInfo)
        {
            _winGold    = user.GetInt("gold");
            _score.text = YxUtiles.ReduceNumber(_winGold);

            PlayerName = user.GetUtfString("nick");
            SetLordMark(userInfo.Id == 0);
            SetBigWinnerMark(false);
            gameObject.SetActive(true);
            PortraitDb.SetPortrait(userInfo.AvatarX, HeadImage, userInfo.SexI);      //设置头像

            if (_winTimeLabel != null)
            {
                _winTimeLabel.text = user.GetInt("win").ToString();
            }
            if (_lostTimeLabel != null)
            {
                _lostTimeLabel.text = user.GetInt("lost").ToString();
            }
        }
示例#2
0
        /// <summary>
        /// 展示房间信息
        /// </summary>
        /// <param name="gameInfo"></param>
        public void ShowRoomInfo(Sfs2X.Entities.Data.ISFSObject gameInfo)
        {
            if (gameInfo.ContainsKey("rid"))
            {
                _roomId           = gameInfo.GetInt("rid");
                _roomIdLabel.text = string.Format("{0}", _roomId);
                _roomIdLabel.gameObject.SetActive(true);
            }

            //设置局数信息
            if (gameInfo.ContainsKey("maxRound"))
            {
                _maxRound = gameInfo.GetInt("maxRound");
                _curRound = gameInfo.GetInt("round");
                RefreshRoundInfo();
            }

            //设置轮数信息
            if (gameInfo.ContainsKey("maxfpround"))
            {
                _maxTurn = gameInfo.GetInt("maxfpround");
                _curTurn = gameInfo.GetInt("fpround");
                RefreshTurnInfo();
            }

            string rule = string.Empty;

            //游戏规则
            if (gameInfo.ContainsKey("rule"))
            {
                rule = gameInfo.GetUtfString("rule");
                InitRuleInfo(rule);
            }

            gameObject.SetActive(true);

            InitInvitBtn(rule);     //初始化微信邀请按钮

            RefreshRoomInfo();
        }
示例#3
0
        /// <summary>
        /// 展示房间信息
        /// </summary>
        /// <param name="gameInfo"></param>
        public void ShowRoomInfo(Sfs2X.Entities.Data.ISFSObject gameInfo)
        {
            if (gameInfo.ContainsKey("rid"))
            {
                _roomID           = gameInfo.GetInt("rid");
                _roomIdLabel.text = _roomID.ToString();
                _roomIdLabel.gameObject.SetActive(true);
            }

            //设置局数信息
            if (gameInfo.ContainsKey("maxRound"))
            {
                _maxRound = gameInfo.GetInt("maxRound");
                _curRound = gameInfo.GetInt("round");
                RefreshRoundInfo();
            }

            //设置轮数信息
            if (gameInfo.ContainsKey("maxfpround"))
            {
                _maxTurn = gameInfo.GetInt("maxfpround");
                _curTurn = gameInfo.GetInt("fpround");
                RefreshTurnInfo();
            }

            //游戏规则
            if (gameInfo.ContainsKey("rule"))
            {
                InitRuleInfo(gameInfo.GetUtfString("rule"));
            }

            gameObject.SetActive(true);

            RefreshRoomInfo();

            //InitInvitBtn();     //初始化微信邀请按钮
        }
示例#4
0
 public override void OnHandleMessage(Sfs2X.Entities.Data.ISFSObject data)
 {
     errorMessage = data.GetUtfString("error");
 }