示例#1
0
        /// <summary>
        /// 更新面板
        /// </summary>
        public void UpdateShow()
        {
            GameData          gd   = GameData.Instance;
            UserInfoPanelData uipd = gd.UserInfoPanelData;

            if (uipd.isPanelShow)
            {
                gameObject.SetActive(true);

                if (SDKManager.Instance.IOSCheckStaus == 1 || SDKManager.Instance.CheckStatus == 1)
                {
                    ParlorMessage.SetActive(false);
                }
                else
                {
                    ParlorMessage.SetActive(true);
                }

                if (gd.PlayerNodeDef.iPlayCardAcc != 0)
                {
                    PlayerNode[0].text = (gd.PlayerNodeDef.iPlayCardTimeAcc / gd.PlayerNodeDef.iPlayCardAcc).ToString("0") + "秒/平均";
                }
                else
                {
                    PlayerNode[0].text = "0秒/平均";
                }

                // Debug.LogError("游戏局数:" + gd.PlayerNodeDef.iGameNumAcc + ",掉线次数:" + gd.PlayerNodeDef.iDisconnectAcc);

                if (gd.PlayerNodeDef.iGameNumAcc != 0)
                {
                    PlayerNode[1].text = ((gd.PlayerNodeDef.iDisconnectAcc / (float)gd.PlayerNodeDef.iGameNumAcc) * 100f).ToString("0.00") + "%";
                }
                else
                {
                    PlayerNode[1].text = "0%";
                }
                //声音关闭按钮显示
                Button[] gomusic = _Music.GetComponentsInChildren <Button>(true);
                gomusic[0].gameObject.SetActive(MahjongCommonMethod.Instance.isMusicShut);
                gomusic[1].gameObject.SetActive(!MahjongCommonMethod.Instance.isMusicShut);
                Button[] goeffect = _Effect.GetComponentsInChildren <Button>(true);
                goeffect[0].gameObject.SetActive(MahjongCommonMethod.Instance.isEfectShut);
                goeffect[1].gameObject.SetActive(!MahjongCommonMethod.Instance.isEfectShut);
                _sliderM.value     = MahjongCommonMethod.Instance.MusicVolume * 0.01f;
                _sliderE.value     = MahjongCommonMethod.Instance.EffectValume * 0.01f;
                PlayerNode[2].text = gd.PlayerNodeDef.iCompliment.ToString();
                PlayerNode[3].text = MahjongCommonMethod.PlayerIp;
                PlayerNode[4].text = gd.PlayerNodeDef.iUserId.ToString();
                PlayerNode[5].text = gd.PlayerNodeDef.szNickname;
                MahjongCommonMethod com = MahjongCommonMethod.Instance;
                com.GetPlayerAvatar(headImage, gd.PlayerNodeDef.szHeadimgurl);
                if (uipd.SettingPanelShow)
                {
                    SettingPanel.SetActive(true);
                }
                else
                {
                    SettingPanel.SetActive(false);
                }

                //处理麻将馆信息
                PlayerNodeDef pnd = GameData.Instance.PlayerNodeDef;
                if (pnd.iMyParlorId > 0)
                {
                    ParlorIdentity.text  = "麻将馆老板";
                    JoinParlorTitle.text = "创建的麻将馆:";
                }
                else
                {
                    ParlorIdentity.text  = "麻将馆会员";
                    JoinParlorTitle.text = "加入的麻将馆:";
                }
                ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
                int parlorCount          = 0;
                for (int i = 0; i < pspd.parlorInfoDef.Length; i++)
                {
                    if (pspd.parlorInfoDef[i] != null && pspd.parlorInfoDef[i].iParlorId > 0)
                    {
                        parlorCount++;
                        Parlor[i].SetActive(true);
                        Parlor[i].transform.GetChild(1).GetComponent <Text>().text = pspd.parlorInfoDef[i].szParlorName;
                    }
                    else
                    {
                        Parlor[i].SetActive(false);
                    }
                }

                if (parlorCount == 0)
                {
                    NoneParlor.SetActive(true);
                }
                else
                {
                    NoneParlor.SetActive(false);
                }


                ParlorCount[0].text = pnd.iLeaveParlorAcc + "次";

                if (pnd.iMyParlorId > 0)
                {
                    ParlorCount[1].text = (pnd.iCreatParlorAcc + 1) + "次";
                }
                else
                {
                    ParlorCount[1].text = (pnd.iCreatParlorAcc) + "次";
                }
                ParlorCount[2].text = pnd.iKickParlorAcc + "次";
                ParlorCount[3].text = pnd.iDismissParlorAcc + "次";
            }
            else
            {
                GameData.Instance.isShowQuitPanel = true;
                gameObject.SetActive(false);
            }
        }
示例#2
0
        /// <summary>
        /// 显示时间
        /// </summary>
        /// <param name="index">时间Text序号</param>
        public void ShowActivityTime(int index)
        {
            HolidayActivityPanelData hapd = GameData.Instance.HolidayActivityPanelData;

            PlayerNodeDef pnd = GameData.Instance.PlayerNodeDef;
        }