Ejemplo n.º 1
0
    void SetupUI(params object[] args)
    {
        detail.HangUp_UIItem.gameObject.SetActive(Game.MJMgr.HangUp);
        detail.VoiceButton_Button.gameObject.SetActive(RoomMgr.IsVipRoom());
        detail.HostedButton_Button.gameObject.SetActive(RoomMgr.IsNormalRoom());

        if (RoomMgr.IsVipRoom())
        {
            detail.DismissButton_Button.gameObject.SetActive(true);
            detail.GameRoundButton_Button.gameObject.SetActive(true);
            int quanNum   = RoomMgr.GetQuanNum();
            int totalQuan = RoomMgr.GetTotalQuan();
            detail.GameRoundText_Text.text = string.Format("{0}/{1}{2}", quanNum, totalQuan, RoomMgr.IsVip2Room()?"局":"圈");

            bool isWaitting = Game.Instance.state == GameState.Waitting;
            detail.WXButton_Button.gameObject.SetActive(isWaitting);
        }
        else
        {
            detail.GameRoundButton_Button.gameObject.SetActive(false);
            detail.DismissButton_Button.gameObject.SetActive(false);
            detail.WXButton_Button.gameObject.SetActive(false);
        }

        OnUpdateCtrlPanel();

        foreach (PlayerSub sub in players)
        {
            sub.gameObject.SetActive(false);
        }

        for (int i = 0; i < Game.MJMgr.MjData.Length; i++)
        {
            int    position = i;
            MjData data     = Game.MJMgr.MjData[position];
            if (null != data.player)
            {
                int index = Game.MJMgr.GetIndexByPosition(position);
                players[index].SetValue(data);
            }
        }

        //MJPlayer self = Game.MJMgr.MyPlayer;
        //MjData selfData = Game.MJMgr.MjData[self.postion];
        //Player selfPlayer = selfData.player;
        //bool isReady = null != selfPlayer && selfPlayer.isReady;
        //detail.StartButton_Button.gameObject.SetActive(!isReady);
        //detail.StartButton_Button.gameObject.SetActive(false);
        //detail.ReadyCancelButton_Button.gameObject.SetActive(false);
        //detail.ReadyButton_Button.gameObject.SetActive(false);
    }