public void OnOKBtnClick() { if (mFreeTimes != 0 && mCost > BalanceResourceUtil.GetUserDiamond()) { BalanceResourceUtil.HcLessMessage(); return; } if (mReviveCount <= 0) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceReviveCtrl_1859")); return; } LTInstanceMapModel.Instance.RequestChallengeRevive(delegate { LTChallengeInstanceHpCtrl.RestHpSum(); if (mFreeTimes != 0) { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, -mCost, "挑战副本复活"); } controller.Close(); if (mCallback != null) { mCallback(true); } }); }
public void SetHp(string heroId, bool isShowTempHp) { //float fullHp = 0; int level = 0; int peak = 0; float percent = 0; if (int.Parse(heroId) < 0)//是否雇佣 { var hireInfo = LTInstanceHireUtil.GetHireInfoByHeroId(int.Parse(heroId)); if (hireInfo != null) { float fullHp = hireInfo.base_MaxHP; float curHp = 0; if (isShowTempHp) { curHp = LTHotfixManager.GetManager <SceneManager>().GetChallengeTempHp(heroId); } else { curHp = LTChallengeInstanceHpCtrl.GetCombatHp(heroId); } percent = curHp / fullHp; level = hireInfo.level; } } else { if (isShowTempHp) { float curHp = LTHotfixManager.GetManager <SceneManager>().GetChallengeTempHp(heroId); float fullHp = 0; DataLookupsCache.Instance.SearchDataByID <float>(string.Format("userCampaignStatus.challengeChapters.team.{0}.MHP", heroId), out fullHp); percent = curHp / fullHp; } else { percent = LTChallengeInstanceHpCtrl.GetCombatHPPercent(heroId); } DataLookupsCache.Instance.SearchIntByID(string.Format("heroStats.{0}.stat.level", heroId), out level); DataLookupsCache.Instance.SearchIntByID(string.Format("heroStats.{0}.proficiency.1.1", heroId), out peak); } percent = Mathf.Min(percent, 1); PercentLabel.text = percent.ToString("0%"); HpProgress.value = percent; DeathLabel.gameObject.SetActive(percent <= 0); PercentLabel.gameObject.SetActive(percent > 0); LTUIUtil.SetLevelText(LevelLabel.transform.parent.GetComponent <UISprite>(), LevelLabel, level + peak); }
public static void EnterInstance(int id) { if (id > 0) { LTChallengeInstanceHpCtrl.RestHpSum();//进入之前重置血量 LTInstanceMapModel.Instance.RequestAlienMazeEnter(id, delegate(string error) { RequestInstanceCallBack(error); }); } }
public override void Awake() { base.Awake(); var t = controller.transform; controller.backButton = t.GetComponent <UIButton>("Edge/TopLeft/BackBtn"); HpCtrl = t.GetMonoILRComponent <LTChallengeInstanceHpCtrl>("Edge/PlayerPanel/Panel/Hp"); FullScreenMask = t.FindEx("Edge/HidePanel/FullScreenMask").gameObject; SkipSprite = t.GetComponent <UISprite>("Edge/BottomLeft/SkipBtn/Check"); QuickSprite = t.GetComponent <UISprite>("Edge/BottomLeft/QuickBtn/Check"); QuickContainerObj = t.gameObject.FindEx("Edge/BottomLeft/QuickBtn"); BossLogBtnObj = t.gameObject.FindEx("Edge/BottomRight/BossLog"); BossLogGuideTS = t.GetComponent <TweenScale>("Edge/BottomRight/BossLog/TipLabel"); ThemeNameLabel = t.GetComponent <UILabel>("Edge/TopLeft/Theme/Label"); ThemeIcon = t.GetComponent <DynamicUISprite>("Edge/TopLeft/Theme/Icon"); ThemeTipNameLabel = t.GetComponent <UILabel>("Edge/TopLeft/Theme/Tips/NameLabel"); ThemeTipsIcon = t.GetComponent <DynamicUISprite>("Edge/TopLeft/Theme/Tips/Theme/Icon"); ThemeTipDescLabel = t.GetComponent <UILabel>("Edge/TopLeft/Theme/Tips/DescLabel"); ThemeTipObj = t.gameObject.FindEx("Edge/TopLeft/Theme/Tips"); FlyMagicObj = t.gameObject.FindEx("Edge/BottomRight/BagBtn/Magic/Fly"); FlyMagicsObj = t.gameObject.FindEx("Edge/BottomRight/BagBtn/Magic/Fly2"); MagicObj = t.gameObject.FindEx("Edge/BottomRight/BagBtn/Magic"); BottomRightObj = t.gameObject.FindEx("Edge/BottomRight"); SpCtrl = t.GetDataLookupILRComponent <LTChallengeSPCtrl>("Edge/BottomRight/BagBtn/Magic/Label"); MagicAlphaTween = t.GetComponent <TweenAlpha>("Edge/BottomRight/BagBtn/Magic"); FlyScrollObj = t.gameObject.FindEx("Edge/BottomRight/BagBtn/ScrollFly"); MagnifyingGlass = t.gameObject.FindEx("Edge/PlayerPanel/Panel/MagnifyingGlass"); EnemyKillSpriteList = controller.FetchComponentList <UISprite>(new string[5] { "Edge/Bottom/DoorBar/Root/Enemy", "Edge/Bottom/DoorBar/Root/Enemy (1)", "Edge/Bottom/DoorBar/Root/Enemy (2)", "Edge/Bottom/DoorBar/Root/Enemy (3)", "Edge/Bottom/DoorBar/Root/Enemy (4)" }); new List <UISprite>(); KeySprite = t.GetComponent <UISprite>("Edge/Bottom/DoorBar/Key"); KeyFxObj = KeySprite.gameObject.FindEx("FX"); BarFxObj = t.gameObject.FindEx("Edge/Bottom/DoorBar/Foreground/FX"); DoorOpenProgress = t.GetComponent <UIProgressBar>("Edge/Bottom/DoorBar"); _clearanceLineupBtn = t.GetMonoILRComponent <LTClearanceLineupBtn>("Edge/TopRight/LTClearanceLineupBtn"); controller.FindAndBindingBtnEvent(new List <string>(6) { "Edge/TopLeft/Theme", "Edge/TopLeft/Theme/Tips/Box", "Edge/BottomLeft/SkipBtn", "Edge/BottomLeft/QuickBtn", "Edge/BottomRight/BagBtn", "Edge/BottomRight/BattleReadyBtn", "Edge/BottomRight/BossLog" }, new List <EventDelegate>(6) { new EventDelegate(OnThemeBtnClick), new EventDelegate(OnThemeTipClick), new EventDelegate(OnSkipBtnClick), new EventDelegate(OnQuickBtnClick), new EventDelegate(OnBagBtnClick), new EventDelegate(OnBattleReadyBtnClick), new EventDelegate(OnBossLogBtnClick) }); }
private void ShowBuddyData() { string teamName = FormationUtil.GetCurrentTeamName(SceneLogic.BattleType); string teamDataPath = SmallPartnerPacketRule.USER_TEAM + "." + teamName + ".team_info"; ArrayList teamDatas; List <string> heroIDs = new List <string>(); if (!IsShowTempHp) { LTChallengeInstanceHpCtrl.UpdateInstanceHpFromCombat(); } DataLookupsCache.Instance.SearchDataByID <ArrayList>(teamDataPath, out teamDatas); if (teamDatas != null) { for (var i = 0; i < teamDatas.Count; i++) { var td = teamDatas[i]; string heroid = EB.Dot.String("hero_id", td, ""); if (!string.IsNullOrEmpty(heroid)) { heroIDs.Add(heroid); } } } for (int i = 0; i < m_HeroItems.Count; i++) { if (i < heroIDs.Count) { string heroid = heroIDs[i]; m_HeroItems[i].mDMono.gameObject.CustomSetActive(true); m_HeroItems[i].ShowUI(heroid, IsShowHp, IsShowTempHp); } else { m_HeroItems[i].mDMono.gameObject.CustomSetActive(false); } } if (LTFormationDataManager.Instance.CurTeamMemberData != null && BattleReadyHudController.ShowMercenary()) { m_HeroItems[heroIDs.Count].mDMono.gameObject.CustomSetActive(true); m_HeroItems[heroIDs.Count].ShowUI(LTFormationDataManager.Instance.CurTeamMemberData, false, false); } }
public static void EnterInstance(int id, bool isResume) { if (id > 0) { LTChallengeInstanceHpCtrl.RestHpSum(); //进入之前重置血量 if (isResume) //手动重连挑战副本 { LTInstanceMapModel.Instance.RequestChallengeResumeChapter(id, delegate(string error) { RequestInstanceCallBack(error); }); } else { LTInstanceMapModel.Instance.RequestChallengeEnterChapter(id, delegate(string error) //正常进入 { RequestInstanceCallBack(error); }); } } }
public override void Awake() { base.Awake(); var t = controller.transform; controller.backButton = t.GetComponent <UIButton>("Edge/TopLeft/BackBtn"); HpCtrl = t.GetMonoILRComponent <LTChallengeInstanceHpCtrl>("Edge/PlayerPanel/Panel/Hp"); FullScreenMask = t.FindEx("Edge/HidePanel/FullScreenMask").gameObject; SkipSprite = t.GetComponent <UISprite>("Edge/BottomLeft/SkipBtn/Check"); ThemeNameLabel = t.GetComponent <UILabel>("Edge/TopLeft/Theme/Label"); ThemeIcon = t.GetComponent <UISprite>("Edge/TopLeft/Theme"); ThemeTipNameLabel = t.GetComponent <UILabel>("Edge/TopLeft/Theme/Tips/NameLabel"); ThemeTipsIcon = t.GetComponent <UISprite>("Edge/TopLeft/Theme/Tips/Theme"); ThemeTipDescLabel = t.GetComponent <UILabel>("Edge/TopLeft/Theme/Tips/DescLabel"); ThemeTipObj = t.FindEx("Edge/TopLeft/Theme/Tips").gameObject; FlyMagicObj = t.FindEx("Edge/BottomRight/BagBtn/Magic/Fly").gameObject; FlyMagicsObj = t.FindEx("Edge/BottomRight/BagBtn/Magic/Fly2").gameObject; MagicObj = t.FindEx("Edge/BottomRight/BagBtn/Magic").gameObject; BottomRightObj = t.FindEx("Edge/BottomRight").gameObject; SpCtrl = t.GetDataLookupILRComponent <LTChallengeSPCtrl>("Edge/BottomRight/BagBtn/Magic/Label"); MagicAlphaTween = t.GetComponent <TweenAlpha>("Edge/BottomRight/BagBtn/Magic"); FlyScrollObj = t.FindEx("Edge/BottomRight/BagBtn/ScrollFly").gameObject; MagnifyingGlass = t.FindEx("Edge/PlayerPanel/Panel/MagnifyingGlass").gameObject; controller.FindAndBindingBtnEvent(new List <string>(6) { "Edge/TopLeft/Theme", "Edge/TopLeft/Theme/Tips/Box", "Edge/TopRight/RuleBtn", "Edge/BottomLeft/SkipBtn", "Edge/BottomRight/BagBtn", "Edge/BottomRight/BattleReadyBtn" }, new List <EventDelegate>(6) { new EventDelegate(OnThemeBtnClick), new EventDelegate(OnThemeTipClick), new EventDelegate(OnRuleBtnClick), new EventDelegate(OnSkipBtnClick), new EventDelegate(OnBagBtnClick), new EventDelegate(OnBattleReadyBtnClick) }); }
private void SetColor(string heroId, bool isShowTempHp) { float hp = 0; if (isShowTempHp) { hp = LTHotfixManager.GetManager <SceneManager>().GetChallengeTempHp(heroId); } else { hp = LTChallengeInstanceHpCtrl.GetCombatHp(heroId); } if (hp <= 0) { Icon.color = GreyColor; QuantityLevelSprite.color = GreyColor; QuantityBGSprite.color = Color.gray; AttrSprite.color = GreyColor; HpSet.LevelLabel.transform.parent.GetComponent <UISprite>().color = GreyColor; for (int i = 0; i < StarList.Length; i++) { StarList[i].GetComponent <UISprite>().color = GreyColor; } } else { Icon.color = WhiteColor; QuantityLevelSprite.color = WhiteColor; //QuantityBGSprite.color = WhiteColor; AttrSprite.color = WhiteColor; HpSet.LevelLabel.transform.parent.GetComponent <UISprite>().color = WhiteColor; for (int i = 0; i < StarList.Length; i++) { StarList[i].GetComponent <UISprite>().color = WhiteColor; } } }