Пример #1
0
        /// <summary>
        /// 打开系统设置按钮
        /// </summary>
        void HandleBtnSettingOpen()
        {
            GameData          gd   = GameData.Instance;
            UserInfoPanelData uipd = gd.UserInfoPanelData;

            uipd.SettingPanelShow = true;
            UpdateShow();
        }
Пример #2
0
        /// <summary>
        /// 关闭系统设置按钮
        /// </summary>
        void HandleBtnSettingClose()
        {
            GameData          gd   = GameData.Instance;
            UserInfoPanelData uipd = gd.UserInfoPanelData;

            uipd.SettingPanelShow = false;
            UpdateShow();
        }
Пример #3
0
        ///// <summary>
        ///// 处理更多按钮
        ///// </summary>
        //void HandleMoreBtn(int status)
        //{
        //    float pos_up = UIMainView.Instance.LobbyPanel.MorePopPanel.transform.localPosition.y +
        //        55f*MahjongCommonMethod.Instance.FindChildNum(UIMainView.Instance.LobbyPanel.MorePopPanel)+UIMainView.Instance.LobbyPanel.ClickBgHieight;
        //    float pos_down = UIMainView.Instance.LobbyPanel.MorePopPanel.transform.localPosition.y-
        //        55f * MahjongCommonMethod.Instance.FindChildNum(UIMainView.Instance.LobbyPanel.MorePopPanel)- UIMainView.Instance.LobbyPanel.ClickBgHieight;
        //    if (status==1)
        //    {
        //        Tweener tweener = UIMainView.Instance.LobbyPanel.MorePopPanel.transform.DOLocalMoveY(pos_up, 0.5f);
        //        //Tweener tweener = UIMainView.Instance.LobbyPanel.MorePopPanel.transform.DOLocalMoveY(80f-316f, 0.5f);
        //        tweener.SetEase(Ease.InSine);
        //        tweener.OnComplete(CallBack_1);
        //    }
        //    else if(status==2)
        //    {
        //        Debug.LogError("pos_down:" + pos_down);
        //        //Tweener tweener = UIMainView.Instance.LobbyPanel.MorePopPanel.transform.DOLocalMoveY(pos_down, 0.5f);
        //        Tweener tweener = UIMainView.Instance.LobbyPanel.MorePopPanel.transform.DOLocalMoveY(pos_down , 0.5f);
        //        tweener.SetEase(Ease.InSine);
        //        tweener.OnComplete(CallBack_2);
        //    }
        //}

        ///// <summary>
        ///// 运动完之后的回调方法
        ///// </summary>
        //void CallBack_1()
        //{
        //    GameData gd = GameData.Instance;
        //    LobbyMainPanelData lmpd = gd.LobbyMainPanelData;
        //    lmpd.MoreStatus = 2;
        //    lmpd.MoveEnd = true;
        //}

        ///// <summary>
        ///// 运动完之后的回调方法
        ///// </summary>
        //void CallBack_2()
        //{
        //    GameData gd = GameData.Instance;
        //    LobbyMainPanelData lmpd = gd.LobbyMainPanelData;
        //    lmpd.MoreStatus = 1;
        //    lmpd.MoveEnd = true;
        //}

        /// <summary>
        /// 处理点击头像按钮的事件
        /// </summary>
        void HandleHeadTitle()
        {
            GameData          gd   = GameData.Instance;
            UserInfoPanelData uipd = gd.UserInfoPanelData;

            uipd.isPanelShow = true;
            SystemMgr.Instance.UserInfoSystem.UpdateShow();
            PlayerPrefs.SetInt("userInfoRed" + GameData.Instance.PlayerNodeDef.iUserId, 2);
        }
Пример #4
0
        /// <summary>
        /// 关闭玩家信息按钮
        /// </summary>
        void HandleBtnClose()
        {
            GameData          gd   = GameData.Instance;
            UserInfoPanelData uipd = gd.UserInfoPanelData;

            uipd.isPanelShow = false;
            GameData.Instance.LobbyMainPanelData.isShowBuyRoomCard = false;
            UpdateShow();
            SystemMgr.Instance.LobbyMainSystem.UpdateShow();
        }
Пример #5
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);
            }
        }