Exemple #1
0
        /// <summary>
        /// 显示投票结果内容
        /// </summary>
        public void ShowHandUp(HupData data, int countDown)
        {
            var gdata = App.GetGameData <NnGameData>();

            gdata.IsInHandsUp = true;
            switch (data.Operation)
            {
            case -1:
                _hupEnd = true;
                break;

            case 2:
                ShowParent.SetActive(true);
                _localId = int.Parse(gdata.GetPlayerInfo().UserId);
                _hups    = new List <HupData>();
                MiddleBtn.SetActive(false);
                CurTime = countDown;
                StartCoroutine(CuntDownTime());
                _hupEnd = false;
                break;

            case 3:
                break;
            }
            _hups.Add(data);
            DealHups();
        }
Exemple #2
0
        /// <summary>
        /// 投票结束
        /// </summary>
        public void HandupEnd()
        {
            RightBtn.SetActive(false);
            LeftBtn.SetActive(false);
            MiddleBtn.SetActive(true);
            _isStopCountDown = true;
            StopCoroutine(CuntDownTime());
            HupData lastData = _hups.Last();

            //            YxDebug.Log("最后投票的玩家是:" + lastData.Id);
            //            YxDebug.Log("当前玩家的ID是:" + _localId);
            TitleLabel.text = string.Format("[581e1e]{0}拒绝解散游戏,投票结束![-]\n", lastData.Id == _localId ? "您" : string.Format("玩家{0}", lastData.Name));
            //            YxDebug.Log("显示的title是:" + TitleLabel.text);
            CountDown.text = "";
            _hups.Clear();
            App.GetGameData <NnGameData>().IsInHandsUp = false;
        }
Exemple #3
0
        public void OnHandsUp(ISFSObject requestData)
        {
            var data = new HupData
            {
                Name      = requestData.GetUtfString(InteractParameter.UserName),
                Id        = requestData.GetInt(RequestKey.KeyId),
                Operation = requestData.GetInt(RequestKey.KeyType)
            };
            int time = App.GetGameData <NnGameData>().HupTime;

            if (requestData.ContainsKey(InteractParameter.CdTime))
            {
                time = requestData.GetInt(InteractParameter.CdTime);
            }
            var gmanager = App.GetGameManager <NnGameManager>();

            gmanager.Result.ShowBg();
            gmanager.HupWindow.ShowHandUp(data, time);
        }