Ejemplo n.º 1
0
        /// <summary>
        /// 公告
        /// </summary>
        private async void OnNoticeButton()
        {
            ETModel.Game.Scene.GetComponent <SoundComponent>().PlayClip(DataCenterComponent.Instance.soundInfo.click);
            if (lobby.GameNoticeCpt == null)
            {
                lobby.GameNoticeCpt = lobby.AddComponent <GameNoticeCpt>();
            }

            lobby.GameNoticeCpt.Open();
        }
Ejemplo n.º 2
0
        public GameLobbyTopPlugin Awake(GameObject panel)
        {
            this.panel = panel;

            this.PlayerInfoBg = this.panel.transform.Find("PlayerInfoBg").GetComponent <Image>();

            this.lobby = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIHallPanel).GetComponent <GameLobbyCpt>();

            this._rf = this.panel.GetComponent <ReferenceCollector>();

            this._PlayerIdText = _rf.Get <GameObject>("PlayerIdText").GetComponent <Text>();

            this._GoldNumberText = _rf.Get <GameObject>("GoldNumberText").GetComponent <Text>();

            this._PlayerNameText = _rf.Get <GameObject>("PlayerNameText").GetComponent <Text>();

            this._HeadImage = _rf.Get <GameObject>("HeadImage").GetComponent <Image>();

            this.AdressCopyText = _rf.Get <GameObject>("AdressCopyText").GetComponent <Text>();

            //this.YuEBaoButton = _rf.Get<GameObject>("YuEBaoButton");

            //this.PromotionButton = _rf.Get<GameObject>("PromotionButton");

            ButtonHelper.RegisterButtonEvent(_rf, "AdressCopyButton", () => {
                Game.PopupComponent.SetClickLock();

                ETModel.Game.Scene.GetComponent <SoundComponent>().PlayClip(DataCenterComponent.Instance.soundInfo.click);

                if (UserDataHelper.UserInfo == null)
                {
                    Game.PopupComponent.ShowMessageBox(DataCenterComponent.Instance.tipInfo.GetUrlWaitTip);

                    return;
                }

                GUIUtility.systemCopyBuffer = GameHelper.GetShareQRCodeURL() + UserDataHelper.UserInfo.PlayerId;

                Game.PopupComponent.ShowMessageBox(DataCenterComponent.Instance.tipInfo.CopyURLSuccTip);
            });

            //ButtonHelper.RegisterButtonEvent(_rf, "YuEBaoButton", () => {

            //    Game.PopupComponent.SetClickLock();

            //    SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

            //    if (lobby.GameYuEBaoCpt == null) lobby.GameYuEBaoCpt = lobby.AddComponent<GameYuEBaoCpt>();

            //    lobby.GameYuEBaoCpt.Open();

            //});

            //ButtonHelper.RegisterButtonEvent(_rf, "PromotionButton", () => {

            //    Game.PopupComponent.SetClickLock();

            //    SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

            //    if (lobby.GamePromoteCpt == null) lobby.GamePromoteCpt = lobby.AddComponent<GamePromoteCpt>();

            //    lobby.GamePromoteCpt.Open();

            //});

            ButtonHelper.RegisterButtonEvent(_rf, "IDCopyButton", () => {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                GUIUtility.systemCopyBuffer = _PlayerIdText.text;

                Game.PopupComponent.ShowMessageBox(DataCenterComponent.Instance.tipInfo.CopyIDSuccTip);
            });

            ButtonHelper.RegisterButtonEvent(_rf, "AdressCopyButton", () => {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                if (UserDataHelper.UserInfo == null)
                {
                    Game.PopupComponent.ShowMessageBox(DataCenterComponent.Instance.tipInfo.GetUrlWaitTip);

                    return;
                }

                GUIUtility.systemCopyBuffer = GameHelper.GetShareQRCodeURL() + UserDataHelper.UserInfo.PlayerId;

                Game.PopupComponent.ShowMessageBox(DataCenterComponent.Instance.tipInfo.CopyURLSuccTip);
            });

            ButtonHelper.RegisterButtonEvent(_rf, "HeadButton", () => {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                if (lobby.GameUserCenterCpt == null)
                {
                    lobby.GameUserCenterCpt = lobby.AddComponent <GameUserCenterCpt>();
                }

                lobby.GameUserCenterCpt.Open();
            });


            return(this);
        }
Ejemplo n.º 3
0
        public GameLobbyBottomPlugin Awake(GameObject panel)
        {
            this.panel = panel;

            this.BottomBg = this.panel.transform.Find("Image (2)").GetComponent <Image>();

            this.lobby = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIHallPanel).GetComponent <GameLobbyCpt>();

            this._rf = this.panel.GetComponent <ReferenceCollector>();

            this.CashButton = _rf.Get <GameObject>("CashButton");

            this.MyRecordButton = _rf.Get <GameObject>("MyRecordButton");

            //this.ServiceButton = _rf.Get<GameObject>("ServiceButton");

            this.NoticeButton = _rf.Get <GameObject>("NoticeButton");

            this.PersonSettingButton = _rf.Get <GameObject>("PersonSettingButton");

            //动态替换

            this.lobbyBg = this.panel.transform.parent.Find("bg").GetComponent <Image>();

            //this.ServiceButtonBg = _rf.Get<GameObject>("ServiceButton").transform.Find("Image").GetComponent<Image>();

            this.NoticeButtonBg = _rf.Get <GameObject>("NoticeButton").transform.Find("Image").GetComponent <Image>();

            this.PersonSettingButtonBg = _rf.Get <GameObject>("PersonSettingButton").transform.Find("Image").GetComponent <Image>();

            this.RankButtonBg = _rf.Get <GameObject>("RankButton").transform.Find("Image").GetComponent <Image>();

            this.MyRecordButtonBg = _rf.Get <GameObject>("MyRecordButton").transform.Find("Image").GetComponent <Image>();


            //公告
            ButtonHelper.RegisterButtonEvent(_rf, "NoticeButton", () => {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                this.OnNoticeButton();
            });

            //设置
            ButtonHelper.RegisterButtonEvent(_rf, "PersonSettingButton", () => {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                if (lobby.GamePersonSettingCpt == null)
                {
                    lobby.GamePersonSettingCpt = lobby.AddComponent <GamePersonSettingCpt>();
                }

                lobby.GamePersonSettingCpt.Open();
            });

            //排行
            ButtonHelper.RegisterButtonEvent(_rf, "RankButton", () => {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                if (lobby.UIRankPanelCpt == null)
                {
                    lobby.UIRankPanelCpt = lobby.AddComponent <UIRankPanelCpt>();
                }
                lobby.UIRankPanelCpt.OnOpen();
            });

            //战绩
            ButtonHelper.RegisterButtonEvent(_rf, "MyRecordButton", () => {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                if (lobby.GameMyRecordCpt == null)
                {
                    lobby.GameMyRecordCpt = lobby.AddComponent <GameMyRecordCpt>();
                }

                lobby.GameMyRecordCpt.Open();
            });

            return(this);
        }