public void Awake() { _rf = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); Root = _rf.Get <GameObject>("Root"); tweenEffectComponent = AddComponent <TweenEffectComponent>(); tweenEffectComponent.Add(TweenAnimationIdType.DDZOverPanel, Root.transform); tweenEffectComponent.Play(TweenAnimationIdType.DDZOverPanel); Title = _rf.Get <GameObject>("Title").GetComponent <Image>(); baseScoreLab = _rf.Get <GameObject>("baseScoreLab").GetComponent <Text>(); bombScoreLab = _rf.Get <GameObject>("bombScoreLab").GetComponent <Text>(); FlowerScoreLab = _rf.Get <GameObject>("FlowerScoreLab").GetComponent <Text>(); LoseLab = _rf.Get <GameObject>("LoseLab"); winLab = _rf.Get <GameObject>("winLab"); Bg = _rf.Get <GameObject>("Bg").GetComponent <Image>(); ButtonHelper.RegisterButtonEvent(_rf, "mask", () => { Game.PopupComponent.SetClickLock(); SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); DDZUIFactory.overPanel.Remove(); DDZConfig.GameScene.DDZReadyPlugin.Show(); DDZGameConfigComponent.Instance.Clear(); }); ButtonHelper.RegisterButtonEvent(_rf, "ChangeTableBtn", () => { Game.PopupComponent.SetClickLock(); SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); DDZConfig.GameScene.RequestChangeRoom(); }); ButtonHelper.RegisterButtonEvent(_rf, "ContinueBtn", () => { Game.PopupComponent.SetClickLock(); SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); DDZUIFactory.overPanel.Remove(); DDZConfig.GameScene.Reset(); DDZConfig.GameScene.RequestPrepare(); DDZGameConfigComponent.Instance.Clear(); }); this.InitData(); }
public override void Init() { base.Init(); ChangeHeadView = ReferenceCollector.Get <GameObject>("ChangeHeadView"); ChangeNameView = ReferenceCollector.Get <GameObject>("ChangeNameView"); NormalInfoView = ReferenceCollector.Get <GameObject>("NormalInfoView"); _changePlayerName = ReferenceCollector.Get <GameObject>("ChangePlayerNameBtn"); _confirmChangeName = ReferenceCollector.Get <GameObject>("ConfirmChangeName"); _cancelChangeName = ReferenceCollector.Get <GameObject>("CancelChangeName"); HeadIcon = ReferenceCollector.GetComponent <Image>("HeadIcon"); PlayerName = ReferenceCollector.GetComponent <Text>("PlayerName"); GoldTxtLab = ReferenceCollector.GetComponent <Text>("GoldTxtLab"); IDLab = ReferenceCollector.GetComponent <Text>("IDLab"); BindPhoneNumLab = ReferenceCollector.GetComponent <Text>("BindPhoneNumLab"); _changeNameInput = ReferenceCollector.GetComponent <InputField>("ChangeNameInput"); _changePlayerName.GetComponent <Button>().onClick.AddListener(OnChangeUserName); _confirmChangeName.GetComponent <Button>().onClick.AddListener(OnConfirmChangeName); _cancelChangeName.GetComponent <Button>().onClick.AddListener(OnCancelChangeName); ReferenceCollector.GetComponent <Button>("ChangeHeadBtn").onClick.AddListener(OnChangeHead); ReferenceCollector.GetComponent <Button>("CopyBtn").onClick.AddListener(OnCopyUserId); ReferenceCollector.GetComponent <Button>("ConfirmChangeHeadBtn").onClick.AddListener(OnConfirmChangeHead); ReferenceCollector.GetComponent <Button>("UpgradeBtn").onClick.AddListener(OnUpgradeBtn); ReferenceCollector.GetComponent <Button>("ChangePwdBtn").onClick.AddListener(OnChangePwd); ReferenceCollector.GetComponent <Button>("CloseChangeHead").onClick.Add(OnCloseChangeHead); changeHeadIcon = ReferenceCollector.GetComponent <Image>("changeHeadIcon"); NameInputField = ReferenceCollector.GetComponent <InputField>("NameInputField"); ButtonHelper.RegisterButtonEvent(ReferenceCollector, "SaveNameBtn", () => { this.OnConfirmChangeName(); }); ButtonHelper.RegisterButtonEvent(ReferenceCollector, "CloseChangeName", () => { ETModel.Game.Scene.GetComponent <SoundComponent>().PlayClip(DataCenterComponent.Instance.soundInfo.click); this.ChangeNameView.SetActive(false); }); ChangeHeadObjs = ReferenceCollector.Get <GameObject>("ChangeHeadObjs").transform; for (int i = 0; i < ChangeHeadObjs.childCount; i++) { var index = i + 0; var btn = ChangeHeadObjs.GetChild(i); btn.GetComponent <Button>().onClick.AddListener(() => { ETModel.Game.Scene.GetComponent <SoundComponent>().PlayClip(DataCenterComponent.Instance.soundInfo.click); SelectChangeHead(btn.GetChild(2).gameObject, index); }); } ReferenceCollector.GetComponent <Button>("mask").onClick.AddListener(OnClickSubClose); UpgradeBtn = ReferenceCollector.Get <GameObject>("UpgradeBtn"); ChangePwdBtn = ReferenceCollector.Get <GameObject>("ChangePwdBtn"); pwdBtnOldPos = ChangePwdBtn.transform.localPosition; UpgradeBtn.SetActive(false); ChangePwdBtn.transform.localPosition = new Vector3(pwdBtnOldPos.x - 200, pwdBtnOldPos.y, 0); Initial(); }
public void Awake() { _rf = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); mask = _rf.Get <GameObject>("mask").GetComponent <Button>(); Root = _rf.Get <GameObject>("Root"); CloseButton = _rf.Get <GameObject>("CloseButton").GetComponent <Button>(); pxjsView = _rf.Get <GameObject>("pxjsView"); wfjsView = _rf.Get <GameObject>("wfjsView"); pxjsBtn = _rf.Get <GameObject>("pxjsBtn").transform.Find("Text").GetComponent <Text>(); wfjsBtn = _rf.Get <GameObject>("wfjsBtn").transform.Find("Text").GetComponent <Text>(); pxBtn = _rf.Get <GameObject>("pxjsBtn").GetComponent <Image>(); wfBtn = _rf.Get <GameObject>("wfjsBtn").GetComponent <Image>(); mask.onClick.AddListener(() => { OnClose(); }); CloseButton.onClick.AddListener(() => { OnClose(); }); ButtonHelper.RegisterButtonEvent(_rf, "pxjsBtn", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); pxjsBtn.color = Color.yellow; wfjsBtn.color = Color.black; pxBtn.sprite = SpriteHelper.GetSprite("ddzgame", "DDZ2_youxuanzhong@2x"); wfBtn.sprite = SpriteHelper.GetSprite("ddzgame", "DDZ2_zuoweixuan@2x"); pxjsView.SetActive(true); wfjsView.SetActive(false); }); ButtonHelper.RegisterButtonEvent(_rf, "wfjsBtn", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); pxjsBtn.color = Color.black; wfjsBtn.color = Color.yellow; pxBtn.sprite = SpriteHelper.GetSprite("ddzgame", "DDZ2_youweixuan@2x"); wfBtn.sprite = SpriteHelper.GetSprite("ddzgame", "DDZ2_zuoxuanzhong@2x"); pxjsView.SetActive(false); wfjsView.SetActive(true); }); Root.transform.localScale = Vector3.zero; Root.transform.DOScale(1f, 0.2f); }
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); }
public GameLobbyGameListPlugin Awake(GameObject panel) { this.panel = panel; this._GameListsDialog = this.panel; this._rf = this.panel.GetComponent <ReferenceCollector>(); this.lobby = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIHallPanel).GetComponent <GameLobbyCpt>(); this.SubGameDic = new Dictionary <int, SubGame>(); this.SubGameModelDic = new Dictionary <int, ETModel.SubGame>(); this.subGameComponentDic = new Dictionary <int, SubGameComponent>(); this.SubGameModelLoadUIDic = new Dictionary <int, ResGroupLoadUIComponent>(); var subGameInfoList = DataCenterComponent.Instance.gameInfo.SubGameInfoList; for (int i = 0; i < subGameInfoList.Count; i++) { SubGameInfo subGameInfo = subGameInfoList[i]; SubGame subGame = SubGameFactory.Create(subGameInfo.GameID, subGameInfo.Index, this); SubGameDic[i] = subGame; GameObject subGameIcon = _rf.Get <GameObject>(subGameInfo.PrefabName); subGame.GetComponent <SubGameComponent>().SetPanel(subGameIcon, subGameInfo.Index); subGameComponentDic[i] = subGame.GetComponent <SubGameComponent>(); //创建MODEL层子游戏 ETModel.SubGame subGameModel = ETModel.SubGameFactory.Create(subGameInfo.GameID, subGameInfo.Index); SubGameModelDic[i] = subGameModel; subGameModel.GetComponent <ResGroupLoadUIComponent>().SetPanel(subGameIcon, subGameModel.Index); SubGameModelLoadUIDic[i] = subGameModel.GetComponent <ResGroupLoadUIComponent>(); } #region Find this._GameType = _rf.Get <GameObject>("GameType"); //this.ZJHButton = _rf.Get<GameObject>("ZJHButton"); //this.NiuNiuButton = _rf.Get<GameObject>("NiuNiuButton"); //this.BJLButton = _rf.Get<GameObject>("BJLButton"); //this.DZButton = _rf.Get<GameObject>("DZButton"); //this.HongHeiButton = _rf.Get<GameObject>("HongHeiButton"); //this.LongHDButton = _rf.Get<GameObject>("LHDButton"); this.DDZButton = _rf.Get <GameObject>("DDZButton"); //this.SGJButton = _rf.Get<GameObject>("SGJButton"); //this.QZNNButton = _rf.Get<GameObject>("QZNNButton"); //ButtonHelper.RegisterButtonEvent(_rf, "NiuNiuButton", () => //{ // Game.PopupComponent.SetClickLock(); // this.OnNiuNiuButton(); } //); //ButtonHelper.RegisterButtonEvent(_rf, "HongHeiButton", () => //{ // Game.PopupComponent.SetClickLock(); // //this.OnHongHeiButton(); // Game.EventSystem.Run(EventIdType.HongHeiEnterGameModule); //} //); //ButtonHelper.RegisterButtonEvent(_rf, "LHDButton", () => //{ // Game.PopupComponent.SetClickLock(); // Game.EventSystem.Run(EventIdType.OnEnterNHDGameModule); //}); //ButtonHelper.RegisterButtonEvent(_rf, "BJLButton", () => //{ // Game.PopupComponent.SetClickLock(); // Game.EventSystem.Run(EventIdType.OnEnterBJLGameModule); //}); //ButtonHelper.RegisterButtonEvent(_rf, "DZButton", () => //{ // Game.PopupComponent.SetClickLock(); // this.OnDZButton(); //}); //ButtonHelper.RegisterButtonEvent(_rf, "QZNNButton", () => //{ // Game.PopupComponent.SetClickLock(); // Game.EventSystem.Run(EventIdType.OnEnterQZNNGameModule, lobby.GameLobbyGameListPlugin._GameType, lobby.GameLobbyGameTypeSelectPlugin._BackGameListsButton); //}); //ButtonHelper.RegisterButtonEvent(_rf, "ZJHButton", () => //{ // Game.PopupComponent.SetClickLock(); // this.OnZJHButton(); //}); //ButtonHelper.RegisterButtonEvent(_rf, "SGJButton", () => //{ // Game.PopupComponent.SetClickLock(); // this.OnSGJButton(); //}); ButtonHelper.RegisterButtonEvent(_rf, "DDZButton", () => { Game.PopupComponent.SetClickLock(); Game.EventSystem.Run(EventIdType.OnEnterDDZGameModule); }); #endregion this.SetAnimationEffect(); this.InitSubGameResGroup(); this.InitSubGameUpdate(); return(this); }
private void InitSettingView() { _soundSlider = ReferenceCollector.Get <GameObject>("SFxSlider").GetComponent <Slider>(); _musicSlider = ReferenceCollector.Get <GameObject>("MusicSlider").GetComponent <Slider>(); SoundIcon = ReferenceCollector.Get <GameObject>("SoundIcon").GetComponent <Image>(); MusicIcon = ReferenceCollector.Get <GameObject>("MusicIcon").GetComponent <Image>(); SoundIconOpen = SpriteHelper.GetSprite("commonui", "Setting2_yinliang_guan_1"); SoundIconClose = SpriteHelper.GetSprite("commonui", "Setting2_yinliang_guan"); MusicIconOpen = SpriteHelper.GetSprite("commonui", "Setting2_yinyue_kai"); MusicIconClose = SpriteHelper.GetSprite("commonui", "Setting2_yinyue_guan"); _musicSlider.value = SoundComponent.Instance.SoundVolume; _soundSlider.value = SoundComponent.Instance.SfxVolume; this.UpdateIcon(); _soundSlider.onValueChanged.Add((value) => { SoundComponent.Instance.SfxVolume = value; this.UpdateIcon(); }); _musicSlider.onValueChanged.Add((value) => { SoundComponent.Instance.SoundVolume = value; this.UpdateIcon(); }); ButtonHelper.RegisterButtonEvent(ReferenceCollector, "SoundIcon", () => { SoundComponent.Instance.SfxVolume = this.SoundIcon.sprite == SoundIconOpen ? 0 : 1; _soundSlider.value = SoundComponent.Instance.SfxVolume; this.UpdateIcon(); }); ButtonHelper.RegisterButtonEvent(ReferenceCollector, "MusicIcon", () => { SoundComponent.Instance.SoundVolume = this.MusicIcon.sprite == MusicIconOpen ? 0 : 1; _musicSlider.value = SoundComponent.Instance.SoundVolume; this.UpdateIcon(); }); ButtonHelper.RegisterButtonEvent(ReferenceCollector, "OneKeyFixBtn", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); Game.PopupComponent.ShowMessageBox(DataCenterComponent.Instance.tipInfo.FixGameSuccessTip); }); ButtonHelper.RegisterButtonEvent(ReferenceCollector, "ChangeAccountBtn", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); this.Logout(); }); }
public void Awake() { _RecordLists = new List <UINoticeListItem>(); var res = ETModel.Game.Scene.GetComponent <ResourcesComponent>(); res.LoadBundle(UIType.UINoticePanel.StringToAB()); var gameObject = res.GetAsset(UIType.UINoticePanel.StringToAB(), UIType.UINoticePanel); this.panelGo = (GameObject)UnityEngine.Object.Instantiate(gameObject); UI ui = ComponentFactory.Create <UI, string, GameObject>(UIType.UINoticePanel, this.panelGo, false); Game.Scene.GetComponent <UIComponent>().Add(ui); this.ReferenceCollector = this.panelGo.GetComponent <ReferenceCollector>(); this.Root = this.ReferenceCollector.Get <GameObject>("Root"); this.GZBtn = this.ReferenceCollector.Get <GameObject>("GZBtn").transform; this.FangPianBtn = this.ReferenceCollector.Get <GameObject>("EmailBtn").transform; _TEC = this.AddComponent <TweenEffectComponent>(); _TEC.Add(TweenAnimationIdType.NoticePanel, this.Root.transform); this.ReferenceCollector.Get <GameObject>("CloseButton").GetComponent <Button>().onClick.AddListener(Close); this.ReferenceCollector.Get <GameObject>("CloseBg").Get <Button>().onClick.AddListener(Close); this.Content = this.ReferenceCollector.Get <GameObject>("Content"); NoMsgTips = ReferenceCollector.Get <GameObject>("NoMsgTips"); Title01 = ReferenceCollector.Get <GameObject>("Title01"); Title02 = ReferenceCollector.Get <GameObject>("Title02"); MsgDialog = ReferenceCollector.Get <GameObject>("MsgDialog"); MsgTitleText = ReferenceCollector.Get <GameObject>("MsgTitleText").Get <Text>(); MsgTxt = ReferenceCollector.Get <GameObject>("MsgTxt").Get <Text>(); MsgTitleImage01 = ReferenceCollector.Get <GameObject>("MsgTitleImage01"); MsgTitleImage02 = ReferenceCollector.Get <GameObject>("MsgTitleImage02"); ButtonHelper.RegisterButtonEvent(this.ReferenceCollector, "MsgCloseBtn", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); MsgDialog.SetActive(false); }); ButtonHelper.RegisterButtonEvent(this.ReferenceCollector, "Closebg", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); MsgDialog.SetActive(false); }); ButtonHelper.RegisterButtonEvent(this.ReferenceCollector, "GZBtn", () => { this.GZBtn.Find("an").gameObject.SetActive(false); this.FangPianBtn.Find("an").gameObject.SetActive(true); SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); GetNotice(); }); ButtonHelper.RegisterButtonEvent(this.ReferenceCollector, "EmailBtn", () => { this.GZBtn.Find("an").gameObject.SetActive(true); this.FangPianBtn.Find("an").gameObject.SetActive(false); SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); GetMail(); }); }
public void Awake() { rc = this.GetParent <UIEx>().GameObject.GetComponent <ReferenceCollector>(); ButtonHelper.RegisterButtonEvent(rc, "VIPLoginBtn", OnClickReturnBtn); }
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); }
public DDZInteractivePlugin Awake(GameObject panel) { this.panel = panel; _rf = this.panel.GetComponent <ReferenceCollector>(); Clock = _rf.Get <GameObject>("Clock"); Num = _rf.Get <GameObject>("Num").GetComponent <Text>(); TipBtn = _rf.Get <GameObject>("TipBtn").GetComponent <Button>(); Clock.SetActive(false); clockComponent = AddComponent <DDZClockComponent>().Awake(Num.gameObject); ButtonHelper.RegisterButtonEvent(_rf, "NotOutBtn", () => { Game.PopupComponent.SetClickLock(); SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); DDZConfig.GameScene.RequestPlayCard(1, new DDZCard()); }); ButtonHelper.RegisterButtonEvent(_rf, "ReSetBtn", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); DDZConfig.GameScene.DDZHandCardPlugin.ReSelect(); }); ButtonHelper.RegisterButtonEvent(_rf, "TipBtn", () => { Game.PopupComponent.SetClickLock(); SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); DDZConfig.GameScene.DDZHandCardPlugin.ReSelect(); var tipCardDic = DDZConfig.GameScene.DDZAIComponent.GetTipCards(); if (tipCardDic != null && tipCardDic.Count > 0) { Log.Debug("获得的提示长度是:" + tipCardDic.Count); if (tipCardIndex == -1) { tipCardIndex = 0; } if (tipCardIndex > tipCardDic.Count - 1) { tipCardIndex = 0; } List <int> tipCards = tipCardDic[tipCardIndex]; DDZConfig.GameScene.DDZHandCardPlugin.SelectTipCard(tipCards); tipCardIndex++; } else { Game.PopupComponent.ShowTips(DataCenterComponent.Instance.tipInfo.NoTipCardsTip); } }); ButtonHelper.RegisterButtonEvent(_rf, "OutBtn", () => { Game.PopupComponent.SetClickLock(); SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); DDZCard _data = new DDZCard(); List <byte> outCardList = DDZConfig.GameScene.DDZHandCardPlugin.GetOutCardList(); _data.Card = PbHelper.CopyFrom(outCardList); foreach (var item in outCardList) { Log.Debug("牌值:" + PokerCardsHelper.GetPokerOfInt(item)); Log.Debug("中文牌:" + PokerCardsHelper.GetPokerString(item)); } _data.CardsNum = outCardList.Count; Log.Debug("出牌的长度:" + _data.CardsNum); //增加判断:出牌是否为空 if (_data.CardsNum <= 0) { DDZConfig.GameScene.DDZMaskPlugin.Show(2); } else { DDZConfig.GameScene.RequestPlayCard(0, _data); } }); this.Reset(); return(this); }
public void Awake(bool a) { IsLoginOut = a; rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); ButtonHelper.RegisterButtonEvent(rc, "MobileBtn", OnMobileBtn); ButtonHelper.RegisterButtonEvent(rc, "FreeePlayBtn", OnFreeePlayBtn); ButtonHelper.RegisterButtonEvent(rc, "RegisterBtn", OnRegisterBtn); ButtonHelper.RegisterButtonEvent(rc, "FixBtn", FixBtn); _FixDialog = rc.Get <GameObject>("FixDialog"); _ChooseDialog = rc.Get <GameObject>("ChooseDialog"); _LoginDialog = rc.Get <GameObject>("LoginDialog"); LoginBg = _FixDialog.transform.parent.Find("Image").GetComponent <Image>(); LoginLogo = LoginBg.transform.Find("Image (2)").GetComponent <Image>(); _FixVersionText = rc.Get <GameObject>("FixVersionText").Get <Text>(); _AppVersionText = rc.Get <GameObject>("AppVersionText").Get <Text>(); _ResouceVersionText = rc.Get <GameObject>("ResouceVersionText").Get <Text>(); ButtonHelper.RegisterButtonEvent(rc, "FixCloseBtn", OnFixCloseBtn); ButtonHelper.RegisterButtonEvent(rc, "FixCloseBtn02", OnFixCloseBtn); ButtonHelper.RegisterButtonEvent(rc, "OneFixBtn", OnOneFixBtn); ButtonHelper.RegisterButtonEvent(rc, "OneGetErrBtn", OnOneGetErrBtn); _RegisterDialogBtn = rc.Get <GameObject>("RegisterDialogBtn"); _LoginDialogBtn = rc.Get <GameObject>("LoginDialogBtn"); _RegisterTitleImage = rc.Get <GameObject>("RegisterTitleImage"); _LoginTitleImage = rc.Get <GameObject>("LoginTitleImage"); _CodeInputField = rc.Get <GameObject>("CodeInputField").Get <InputField>(); _MobileInputField = rc.Get <GameObject>("MobileInputField").Get <InputField>(); ButtonHelper.RegisterButtonEvent(rc, "LoginDialogClose", OnLoginDialogClose); ButtonHelper.RegisterButtonEvent(rc, "LoginDialogClose02", OnLoginDialogClose); ButtonHelper.RegisterButtonEvent(rc, "RegisterDialogBtn", OnRegisterDialogBtn); ButtonHelper.RegisterButtonEvent(rc, "LoginDialogBtn", OnLoginDialogBtn); ButtonHelper.RegisterButtonEvent(rc, "GetCode", OnGetCode); GetCodeBtn = rc.Get <GameObject>("GetCode"); _CountTimeText = rc.Get <GameObject>("CountTimeText").Get <Text>(); //-------选择账号面板 ButtonHelper.RegisterButtonEvent(rc, "ChooseDialogClose", OnChooseDialogClose); ButtonHelper.RegisterButtonEvent(rc, "ChooseDialogClose02", OnChooseDialogClose); ButtonHelper.RegisterButtonEvent(rc, "ChooseDialogLoginBtn", OnChooseDialogLoginBtn); RegisterBtn01 = rc.Get <GameObject>("RegisterBtn01"); RegisterBtn02 = rc.Get <GameObject>("RegisterBtn02"); RegisterBtn03 = rc.Get <GameObject>("RegisterBtn03"); ButtonHelper.RegisterButtonEvent(rc, "RegisterBtn01", OnRegisterBtn01); ButtonHelper.RegisterButtonEvent(rc, "RegisterBtn02", OnRegisterBtn02); ButtonHelper.RegisterButtonEvent(rc, "RegisterBtn03", OnRegisterBtn03); LoginBtn01 = rc.Get <GameObject>("LoginBtn01"); LoginBtn02 = rc.Get <GameObject>("LoginBtn02"); LoginBtn03 = rc.Get <GameObject>("LoginBtn03"); ButtonHelper.RegisterButtonEvent(rc, "LoginBtn01", OnLoginBtn01); ButtonHelper.RegisterButtonEvent(rc, "LoginBtn02", OnLoginBtn02); ButtonHelper.RegisterButtonEvent(rc, "LoginBtn03", OnLoginBtn03); ButtonHelper.RegisterButtonEvent(rc, "DeleteBtn01", OnDeleteBtn01); ButtonHelper.RegisterButtonEvent(rc, "DeleteBtn02", OnDeleteBtn01); ButtonHelper.RegisterButtonEvent(rc, "DeleteBtn03", OnDeleteBtn01); //开始大版本检测 Game.EventSystem.Run(EventIdType.CheckLargeVersion, new Action(() => { })); }
public void Awake() { _rf = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); Root = _rf.Get <GameObject>("Root"); SoundIcon = _rf.Get <GameObject>("SoundIcon").GetComponent <Image>(); MusicIcon = _rf.Get <GameObject>("MusicIcon").GetComponent <Image>(); SFxSlider = _rf.Get <GameObject>("SFxSlider").GetComponent <Slider>(); MusicSlider = _rf.Get <GameObject>("MusicSlider").GetComponent <Slider>(); SoundIconOpen = SpriteHelper.GetSprite("commonui", "Setting2_yinliang_guan_1"); SoundIconClose = SpriteHelper.GetSprite("commonui", "Setting2_yinliang_guan"); MusicIconOpen = SpriteHelper.GetSprite("commonui", "Setting2_yinyue_kai"); MusicIconClose = SpriteHelper.GetSprite("commonui", "Setting2_yinyue_guan"); ButtonHelper.RegisterButtonEvent(_rf, "CloseButton", OnClose); ButtonHelper.RegisterButtonEvent(_rf, "mask", OnClose); ButtonHelper.RegisterButtonEvent(_rf, "SoundIcon", () => { SoundComponent.Instance.SfxVolume = this.SoundIcon.sprite == SoundIconOpen ? 0:1; SFxSlider.value = SoundComponent.Instance.SfxVolume; this.UpdateIcon(); }); ButtonHelper.RegisterButtonEvent(_rf, "MusicIcon", () => { SoundComponent.Instance.SoundVolume = this.MusicIcon.sprite == MusicIconOpen ? 0:1; MusicSlider.value = SoundComponent.Instance.SoundVolume; this.UpdateIcon(); }); ButtonHelper.RegisterButtonEvent(_rf, "OneKeyFixBtn", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); Game.PopupComponent.ShowMessageBox(DataCenterComponent.Instance.tipInfo.FixGameSuccessTip); }); ButtonHelper.RegisterButtonEvent(_rf, "ChangeAccountBtn", () => { SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click); this.Logout(); }); MusicSlider.value = SoundComponent.Instance.SoundVolume; SFxSlider.value = SoundComponent.Instance.SfxVolume; this.UpdateIcon(); SFxSlider.onValueChanged.Add((value) => { SoundComponent.Instance.SfxVolume = value; this.UpdateIcon(); }); MusicSlider.onValueChanged.Add((value) => { SoundComponent.Instance.SoundVolume = value; this.UpdateIcon(); }); }