local UIGoldenHeroBossBattleSummary = UIViewClass() local AutoExitLevelTime = DataSheetManager.ConstData:GetDataByID("AutoExitBarrier").IntValue local DelayTiming = 0.5 function UIGoldenHeroBossBattleSummary:OnOpened(context) UIUtils.SetActive(self.panel_Summary.gameObject, false) self.result = context.battleResult self:StartRepeatFunc(self.OnUpdateFun, 0) local heroData = DataSheetManager.HeroNum:GetDataByID(BattleDataGetter.GetMainPlayerCharacterID()) self.delayTime = heroData.PoseTime / 1000 + DelayTiming CTL.Sound.PlayGameSound("MUSIC_Victory") end function UIGoldenHeroBossBattleSummary:OnUpdateFun(deltaTime, timeSinceUpdate) UIUtils.SetLabel(self.txt_Tips, string.format(UIUtils.GetLocalizedTxt(Const_IDS.IDS_AutoExit), math.abs(math.ceil(AutoExitLevelTime - timeSinceUpdate)))) if timeSinceUpdate > AutoExitLevelTime then self:BackTown() elseif timeSinceUpdate > self.delayTime and not self.panel_Summary.gameObject.activeInHierarchy then self:ShowSummary() end end function UIGoldenHeroBossBattleSummary:ShowSummary() UIUtils.SetActive(self.panel_Summary.gameObject, true) CameraController.Instance:SetDOF(true, 2) self.txt_Damage.text = self.result.damage self.txt_DamagePoint.text = self.result.score local killScore = self.result.killScore self.txt_KillPoint.text = killScore UIUtils.SetActive(self.group_KillPoint, killScore ~= 0) local heroAdd = self.result.heroAdd if heroAdd ~= 0 then local heroName = UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.HeroNum:GetDataByID(self.result.heroId).NameIDS]) self.lab_HeroAdd.text = string.format(UIUtils.GetLocalizedTxt(Const_IDS.IDS_GoldHeroActivity_SynergyBoss_Battle_Hint6), heroName) self.txt_HeroAdd.text = heroAdd UIUtils.SetActive(self.group_HeroAdd, true) else UIUtils.SetActive(self.group_HeroAdd, false) end local heroType = MDL.GoldenHeroMain.GetHeroTypeByActivityId(self.result.activityId) local itemId = DataSheetManager.GoldHeroActivityModeData:GetDataByHeroType(heroType).BossCurrency UTL.Item.SetItemCell(self.item, itemId, self.result.currencyNum) self.txt_TotalPoints.text = heroAdd + killScore + self.result.score self.summaryTemplateEffectHandle1,self.summaryTemplateEffectHandle2 = CTL.LevelSelect.ShowCommonSummaryTemplate(self,true) end function UIGoldenHeroBossBattleSummary:OnButtonClicked(comp) if comp == self.btn_BackTown then self:BackTown() elseif comp == self.item.event_Click then local heroType = MDL.GoldenHeroMain.GetHeroTypeByActivityId(self.result.activityId) local itemId = DataSheetManager.GoldHeroActivityModeData:GetDataByHeroType(heroType).BossCurrency UTL.ItemTips.ShowCommonTipsById(itemId) end end -- 点击按钮回城 function UIGoldenHeroBossBattleSummary:BackTown() MDL.Level.SendRoleLeaveFuben() self:StopRepeatFunc(self.OnUpdateFun) end function UIGoldenHeroBossBattleSummary:OnClosed() CTL.LevelSelect.RemoveSummaryTemplateEffect(self) end return UIGoldenHeroBossBattleSummary