public override IEnumerator OnAddToStack() { CampaignTextureCmp BG = controller.gameObject.GetComponent <CampaignTextureCmp>(); BG.spriteName = "Game_Background_2"; NationManager.Instance.GetTerritoryInfo(null); GameDataSparxManager.Instance.RegisterListener(NationManager.TerritoryDataId, OnTerritoryListListener); if (NationManager.Instance.BattleTimeConfig.GetIsAtBattleTime()) { NationManager.Instance.BattleTimeConfig.InitCountDownTime(); StartCoroutine(CountdownBattleEndTime()); CombatOpenTimeLabel.transform.parent.gameObject.SetActive(false); CombatCountdownTimeLabel.transform.parent.gameObject.SetActive(true); } else { LTUIUtil.SetText(CombatOpenTimeLabel, NationManager.Instance.BattleTimeConfig.TimeStr); CombatOpenTimeLabel.transform.parent.gameObject.SetActive(true); CombatCountdownTimeLabel.transform.parent.gameObject.SetActive(false); } Hotfix_LT.Messenger.AddListener(Hotfix_LT.EventName.RedPoint_Nation, SetRP); Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.RedPoint_Nation); yield return(base.OnAddToStack()); }
public override IEnumerator OnRemoveFromStack() { CampaignTextureCmp BG = controller.gameObject.GetComponent <CampaignTextureCmp>(); BG.spriteName = string.Empty; Hotfix_LT.Messenger.RemoveListener(Hotfix_LT.EventName.RedPoint_Nation, SetRP); GameDataSparxManager.Instance.UnRegisterListener(NationManager.TerritoryDataId, OnTerritoryListListener); DestroySelf(); yield break; }
public override void Awake() { base.Awake(); BGTexture = controller.transform.Find("BG_Texture").GetComponent <CampaignTextureCmp>(); BGTexture.spriteName = "Game_Background_14"; RoleIcon = controller.transform.Find("Anchor_Mid/Info/Icon").GetComponent <UISprite>(); TitleLabel = controller.transform.Find("Anchor_Mid/Info/TipRoot").GetComponent <UILabel>(); CurLevelLabel = controller.transform.Find("Anchor_Mid/Info/TipRoot/LevelLabel").GetComponent <UILabel>(); NextLevelLabe = controller.transform.Find("Anchor_Mid/Info/TipRoot/LevelLabel (1)").GetComponent <UILabel>(); ATKTitleLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/0/NameLabel").GetComponent <UILabel>(); curAddATKLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/0/NumLabel").GetComponent <UILabel>(); nextAddATKLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/0/EquipNumLabel").GetComponent <UILabel>(); DefTitleLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/1/NameLabel").GetComponent <UILabel>(); curAddDefLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/1/NumLabel").GetComponent <UILabel>(); nextAddDefLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/1/EquipNumLabel").GetComponent <UILabel>(); MaxHPTitleLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/2/NameLabel").GetComponent <UILabel>(); curAddMAXHPLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/2/NumLabel").GetComponent <UILabel>(); nextAddMaxHPLabel = controller.transform.Find("Anchor_Mid/Info/AttrList/2/EquipNumLabel").GetComponent <UILabel>(); BreakItem = controller.transform.Find("Anchor_Mid/Info/LTShowItem").GetMonoILRComponent <LTShowItem>(); BreakItemLabel = controller.transform.Find("Anchor_Mid/Info/LTShowItem/CountLabel").GetComponent <UILabel>(); RedPoint = controller.transform.Find("Anchor_Mid/Info/BreakBtn/RedPoint").gameObject; BreakBtnLabel = controller.transform.Find("Anchor_Mid/Info/BreakBtn/Label").GetComponent <UILabel>(); UpLevelFx = controller.transform.Find("BG_Texture/Uplevel").gameObject; controller.backButton = controller.transform.Find("Anchor_TopLeft/CancelBtn").GetComponent <UIButton>(); GridTween = controller.transform.Find("Anchor_Mid/Grid").GetComponent <TweenPosition>(); Grid1Tween = controller.transform.Find("Anchor_Mid/Grid (1)").GetComponent <TweenPosition>(); HotfixBtn = controller.transform.Find("Anchor_TopRight/Rule").GetComponent <UIButton>(); HotfixBtn.onClick.Add(new EventDelegate(OnTipButtonClick)); HotfixCoolBtn0 = controller.transform.Find("Anchor_Mid/Info/BreakBtn").GetComponent <ConsecutiveClickCoolTrigger>(); HotfixCoolBtn0.clickEvent.Add(new EventDelegate(OnBreakThrouthBtnClick)); lockDes = controller.transform.Find("Anchor_BottomRight/LockDes").GetComponent <UILabel>(); TonextObj = controller.transform.Find("Anchor_BottomRight").gameObject; toNext = controller.transform.Find("Anchor_BottomRight/Label").GetComponent <UILabel>(); RightRedPoint = controller.transform.Find("Anchor_BottomRight/RightBtn/RedPoint").gameObject; controller.transform.Find("Anchor_BottomRight/RightBtn").GetComponent <ConsecutiveClickCoolTrigger>().clickEvent.Add(new EventDelegate(() => OnClickTurnthepageBtn(true))); toLast = controller.transform.Find("Anchor_BottomLeft/Label").GetComponent <UILabel>(); controller.transform.Find("Anchor_BottomLeft/Label/LeftBtn").GetComponent <ConsecutiveClickCoolTrigger>().clickEvent.Add(new EventDelegate(() => OnClickTurnthepageBtn(false))); BreakBtnBox = HotfixCoolBtn0.GetComponent <BoxCollider>(); MonoILRFunc(); Vector2 v2 = GameUtils.GetPosWithConstrained(2730, 50); leftPos = new Vector3(-v2.x, v2.y, 0); midPos = new Vector3(0, v2.y, 0); rightPos = new Vector3(v2.x, v2.y, 0); }
public override void Awake() { base.Awake(); RedPoint = mDMono.transform.Find("RedPoint").gameObject; EmptyObj = mDMono.transform.Find("Empty").gameObject; FilledObj = mDMono.transform.Find("Filled").gameObject; TextureCamp = mDMono.transform.Find("Filled/Portrait").GetComponent <CampaignTextureCmp>(); AttrSprite = mDMono.transform.Find("BG/Attr").GetComponent <UISprite>(); GradeSprite = mDMono.transform.Find("Filled/Grade").GetComponent <UISprite>(); StarGrid = mDMono.transform.Find("Filled/Star").GetComponent <UIGrid>(); SSRParticle = mDMono.transform.Find("Filled/Fx/SSR").gameObject; trigger = mDMono.transform.Find("BG").GetComponent <UIEventTrigger>(); trigger.onClick.Add(new EventDelegate(OnItemClick)); EmptyObj.CustomSetActive(true); FilledObj.CustomSetActive(false); }
public override void Awake() { base.Awake(); var t = controller.transform; MapCtrl = t.GetMonoILRComponentByClassPath <LTInstanceMapCtrl>("Hotfix_LT.UI.LTInstanceMapCtrl"); MaskTex = t.GetComponent <CampaignTextureCmp>("Edge/Mask/MaskBG"); RenderSetting = t.GetComponent <RenderSettings>("LTInstanceRenderSetting"); uiEdgPanel = t.GetComponent <UIPanel>("Edge"); controller.FindAndBindingBtnEvent(new List <string>(2) { "Edge/TopLeft/FriendBtn", "Edge/TopLeft/ChatBtn" }, new List <EventDelegate>(2) { new EventDelegate(OnFriendBtnClick), new EventDelegate(OnChatBtnClick) }); }
public override void Awake() { base.Awake(); var t = mDMono.transform; _campaignTextureCmp = t.GetComponent <CampaignTextureCmp>("Icon"); _texIcon = t.GetComponent <UITexture>("Icon"); _upstarfx = t.FindEx("Icon/upstarfx").gameObject; _promotionfx = t.FindEx("Icon/promotionfx").gameObject; _labName = t.GetComponent <UILabel>("Name"); _generalTrainingController = t.GetMonoILRComponent <LTPromotionTrainingButtonController>("BtnGroup/Lab_GeneralTraining"); _eliteTrainingController = t.GetMonoILRComponent <LTPromotionTrainingButtonController>("BtnGroup/Lab_EliteTraining"); _starGroupController = t.GetMonoILRComponent <LTPromotionStarGroupController>("StarRoot"); _attrGroupController = t.GetMonoILRComponent <LTPromotionAttributeGroupController>("AttrGroup"); saveBtn = t.GetComponent <ConsecutiveClickCoolTrigger>("BtnGroup/Btn_Save"); saveBtn.clickEvent.Add(new EventDelegate(delegate { FusionAudio.PostEvent("UI/General/ButtonClick"); if (LTPromotionManager.Instance.HasTrainingResult()) { LTPromotionManager.Instance.Api.RequestSave(true, ht => { DataLookupsCache.Instance.CacheData("promotion", null); DataLookupsCache.Instance.CacheData(ht); if (timer1 != 0) { ILRTimerManager.instance.RemoveTimerSafely(ref timer1); } timer1 = ILRTimerManager.instance.AddTimer(2000, 1, (int seq) => { mDMono.transform.parent.GetUIControllerILRComponent <LTPromotionUIController>(false)?.Refresh();//保存数据之后刷新晋升界面动画 }); MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_SAVE_SUCCESSFULLY")); Hotfix_LT.Messenger.Raise <int, bool>(EventName.OnRefreshAllPowerChange, -1, true); SetButtonState(); }); } else { SetButtonState(); } })); cancleBtn = t.GetComponent <ConsecutiveClickCoolTrigger>("BtnGroup/Lab_Cancle"); cancleBtn.clickEvent.Add(new EventDelegate(delegate { FusionAudio.PostEvent("UI/General/ButtonClick"); if (LTPromotionManager.Instance.HasTrainingResult()) { LTPromotionManager.Instance.Api.RequestSave(false, ht => { DataLookupsCache.Instance.CacheData("promotion", null); DataLookupsCache.Instance.CacheData(ht); mDMono.transform.parent.GetUIControllerILRComponent <LTPromotionUIController>(false)?.Refresh();//保存数据之后刷新晋升界面动画 SetButtonState(); }); } else { SetButtonState(); } })); _campaignTextureCmp.onLoadingOver.Add(new EventDelegate(() => { _texIcon.keepAspectRatio = UIWidget.AspectRatioSource.Free; _texIcon.MakePixelPerfect(); _texIcon.keepAspectRatio = UIWidget.AspectRatioSource.BasedOnHeight; _texIcon.height = (int)(_texIcon.mainTexture.height * 1.42f); })); }
public override void Awake() { base.Awake(); if (mDMono.ObjectParamList != null) { var count = mDMono.ObjectParamList.Count; if (count > 0 && mDMono.ObjectParamList[0] != null) { m_Icon = ((GameObject)mDMono.ObjectParamList[0]).GetComponentEx <DialogueTextureCmp>(); } if (count > 1 && mDMono.ObjectParamList[1] != null) { m_SpriteIcon = ((GameObject)mDMono.ObjectParamList[1]).GetComponentEx <CampaignTextureCmp>(); } if (count > 2 && mDMono.ObjectParamList[2] != null) { m_SpeakName = ((GameObject)mDMono.ObjectParamList[2]).GetComponentEx <UILabel>(); } if (count > 3 && mDMono.ObjectParamList[3] != null) { m_SpeakContext = ((GameObject)mDMono.ObjectParamList[3]).GetComponentEx <UILabel>(); } if (count > 4 && mDMono.ObjectParamList[4] != null) { ContextBg = ((GameObject)mDMono.ObjectParamList[4]).GetComponentEx <UISprite>(); } if (count > 5 && mDMono.ObjectParamList[5] != null) { m_LazySpeakContext = ((GameObject)mDMono.ObjectParamList[5]).GetMonoILRComponent <UILazyLabel>(); } if (count > 6 && mDMono.ObjectParamList[6] != null) { lobbyTexture = ((GameObject)mDMono.ObjectParamList[6]).GetComponentEx <UITexture>(); } } if (mDMono.Vector3ParamList != null) { var count = mDMono.Vector3ParamList.Count; if (count > 0) { dialogueLightRotate = mDMono.Vector3ParamList[0]; } } if (mDMono.StringParamList != null) { var count = mDMono.StringParamList.Count; if (count > 0) { m_Soujin = mDMono.StringParamList[0]; } if (count > 1) { currentAudioName = mDMono.StringParamList[1]; } } }
private void SetCountryInfo(UISprite CountryIcon, CampaignTextureCmp CountryFlagLeft, CampaignTextureCmp CountryFlagRight, UILabel CountryName, UILabel NameShd, string nationName) { CountryIcon.spriteName = NationUtil.NationIcon(nationName); CountryFlagLeft.spriteName = CountryFlagRight.spriteName = NationUtil.NationFlag(nationName); CountryName.text = NameShd.text = NationUtil.LocalizeNationName(nationName); }
public override void Awake() { base.Awake(); BGTexture = controller.transform.Find("UIFrameBG/FrameFG").GetComponent <CampaignTextureCmp>(); rankLabel = controller.transform.Find("UIFrameBG/TopLeftAnchor/Rank/Number").GetComponent <UILabel>(); logRedPoint = controller.transform.Find("UIFrameBG/TopRightAnchor/Misc/LogBtn/RedPoint").gameObject; readyRedPoint = controller.transform.Find("UIFrameBG/TopRightAnchor/Misc/EmbattleBtn/RedPoint").gameObject; timesLabel = controller.transform.Find("Content/Limit/LeftTimes/Number").GetComponent <UILabel>(); challengers = new ArenaChallengerController[3]; challengers[0] = controller.transform.GetMonoILRComponent <ArenaChallengerController>( "Content/ChallengerList/Challenger0"); challengers[1] = controller.transform.GetMonoILRComponent <ArenaChallengerController>( "Content/ChallengerList/Challenger1"); challengers[2] = controller.transform.GetMonoILRComponent <ArenaChallengerController>( "Content/ChallengerList/Challenger2"); challengers_Button = new UIButton[3]; challengers_Button[0] = challengers[0].mDMono.transform.Find("ChallengeBtn").GetComponent <UIButton>(); challengers_Button[0].onClick.Add(new EventDelegate(() => { OnChallengeButtonClick(challengers[0]); })); challengers_Button[1] = challengers[1].mDMono.transform.Find("ChallengeBtn").GetComponent <UIButton>(); challengers_Button[1].onClick.Add(new EventDelegate(() => { OnChallengeButtonClick(challengers[1]); })); challengers_Button[2] = challengers[2].mDMono.transform.Find("ChallengeBtn").GetComponent <UIButton>(); challengers_Button[2].onClick.Add(new EventDelegate(() => { OnFastButtonClick(challengers[2]); })); challengers[0].mDMono.transform.Find("BG").GetComponent <UIEventTrigger>().onClick.Add(new EventDelegate(() => { OnPlayerCheckClick(challengers[0]); })); challengers[1].mDMono.transform.Find("BG").GetComponent <UIEventTrigger>().onClick.Add(new EventDelegate(() => { OnPlayerCheckClick(challengers[1]); })); challengers[2].mDMono.transform.Find("BG").GetComponent <UIEventTrigger>().onClick.Add(new EventDelegate(() => { OnPlayerCheckClick(challengers[2]); })); awardItems = new LTShowItem[3]; awardItems[0] = controller.transform.Find("Content/Limit/RankAward/Grid/LTShowItem").GetMonoILRComponent <LTShowItem>(); awardItems[1] = controller.transform.Find("Content/Limit/RankAward/Grid/LTShowItem (1)").GetMonoILRComponent <LTShowItem>(); awardItems[2] = controller.transform.Find("Content/Limit/RankAward/Grid/LTShowItem (2)").GetMonoILRComponent <LTShowItem>(); EmptyLabel = controller.transform.Find("Content/Limit/RankAward/EmptyAward").gameObject; RenderSetting = controller.transform.Find("Content/ArenaRenderSetting").GetComponent <RenderSettings>(); ModelTexture = controller.transform.Find("CamTexture").GetComponent <UITexture>(); ModelCamera = controller.transform.Find("Camera").GetComponent <Camera>(); HotfixBtn0 = controller.transform.Find("UIFrameBG/TopLeftAnchor/TopLeft/CancelBtn").GetComponent <UIButton>(); HotfixBtn0.onClick.Add(new EventDelegate(OnCancelButtonClick)); HotfixBtn1 = controller.transform.Find("UIFrameBG/TopLeftAnchor/RuleTipsBtn").GetComponent <UIButton>(); HotfixBtn1.onClick.Add(new EventDelegate(() => { OnTipsButtonClick(HotfixBtn1); })); HotfixBtn5 = controller.transform.Find("UIFrameBG/TopRightAnchor/Misc/AwardBtn").GetComponent <UIButton>(); HotfixBtn5.onClick.Add(new EventDelegate(OnGotoRankAwardButtonClick)); HotfixBtn6 = controller.transform.Find("UIFrameBG/TopRightAnchor/Misc/ExchangeShopBtn").GetComponent <UIButton>(); HotfixBtn6.onClick.Add(new EventDelegate(() => { OnExchangeShopButtonClick(HotfixBtn6); })); HotfixBtn7 = controller.transform.Find("UIFrameBG/TopRightAnchor/Misc/GoToLeaderboardBtn").GetComponent <UIButton>(); HotfixBtn7.onClick.Add(new EventDelegate(() => { OnGoToLeaderboardButtonClick(HotfixBtn7); })); HotfixBtn8 = controller.transform.Find("UIFrameBG/TopRightAnchor/Misc/LogBtn").GetComponent <UIButton>(); HotfixBtn8.onClick.Add(new EventDelegate(() => { OnGoToLogsButtonClick(HotfixBtn8); })); HotfixBtn9 = controller.transform.Find("UIFrameBG/TopRightAnchor/Misc/EmbattleBtn").GetComponent <UIButton>(); HotfixBtn9.onClick.Add(new EventDelegate(OnEmbattleButtonClick)); HotfixBtn13 = controller.transform.Find("Content/Limit/LeftTimes/AddBtn").GetComponent <UIButton>(); HotfixBtn13.onClick.Add(new EventDelegate(OnBuyTimesButtonClick)); HotfixBtn14 = controller.transform.Find("Content/Limit/LeftTimes/RefreshBtn").GetComponent <UIButton>(); HotfixBtn14.onClick.Add(new EventDelegate(OnBuyTimesButtonClick)); RefreshChallengersBtn = controller.transform.Find("Content/Limit/LeftTimes/RefreshChallengersBtn").GetComponent <UIButton>(); RefreshChallengersBtn.onClick.Add(new EventDelegate(OnRefreshChallengersButtonClick)); }