local UIGoldenHeroStoryAchieve = UIViewClass() local SHOW_DURATION = 7 local SHOW_CloseButton = 3 function UIGoldenHeroStoryAchieve:OnOpened(context) self.endingID = context.endingID self.endingInfo = context.endingInfo UIUtils.SetActive(self.group_label, false) UIUtils.SetActive(self.btn_Close, false) self:InitEndingView() self:StartRepeatFunc(self.RepeatFunc1, 0.7) self:StartRepeatFunc(self.RepeatFunc2, SHOW_DURATION) self:StartRepeatFunc(self.RepeatFunc3, SHOW_CloseButton) CTL.Sound.PlayGameSound("UI_kaiqi") end function UIGoldenHeroStoryAchieve:RepeatFunc1(deltaTime, timeSinceUpdate) UIUtils.SetActive(self.group_label, true) end function UIGoldenHeroStoryAchieve:RepeatFunc2(deltaTime, timeSinceUpdate) self:CloseView() end function UIGoldenHeroStoryAchieve:RepeatFunc3(deltaTime, timeSinceUpdate) UIUtils.SetActive(self.btn_Close, true) end function UIGoldenHeroStoryAchieve:OnBackButtonPressed() if self.btn_Close.gameObject.activeSelf then self:OnButtonClicked(self.btn_Close) end end function UIGoldenHeroStoryAchieve:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() end end function UIGoldenHeroStoryAchieve:InitEndingView() UIUtils.SetImageByAssetBundle(self.img_Ending, self.endingInfo.Pic_Big) -- 结局图片 UIUtils.SetLabelText(self.txt_EndingName, Const_IDS[self.endingInfo.EndingName]) -- 结局标题 end return UIGoldenHeroStoryAchieve