local UIExpelMonsterCountDown = UIViewClass() function UIExpelMonsterCountDown:OnOpened(context) UIUtils.SetActive(self.UICommonPopShowView.TextBtn2, false) UIUtils.SetLabelText(self.UICommonPopShowView.TextBtn1, Const_IDS.IDS_BUTTON_CONFIRM) UIUtils.SetLabelText(self.UICommonPopShowView.lab_Title, Const_IDS.IDS_ActivityBossFight_Title) self.duration = DataSheetManager.ConstData:GetDataByID("ActivityBossFightCountDownTime").IntValue self:SetNumber(self.duration) self:StartRepeatFunc(self.OnUpdateFun, 1) UIUtils.SetActive(self.UICommonPopShowView.btn_2, false) UIUtils.SetActive(self.mask, false) end function UIExpelMonsterCountDown:OnUpdateFun(deltaTime, timeSinceUpdate) if timeSinceUpdate > self.duration then self:CloseView() else local time = math.ceil(self.duration - timeSinceUpdate) self:SetNumber(time) end end function UIExpelMonsterCountDown:SetNumber(time) self.number.text = time CTL.Sound.PlayCountDown(time) end function UIExpelMonsterCountDown:OnButtonClicked(comp) if comp == self.UICommonPopShowView.btn_1 then UIUtils.SetActive(self.UICommonPopShowView.gameObject, false) UIUtils.SetActive(self.group_Info, false) UIUtils.SetActive(self.mask, true) end end return UIExpelMonsterCountDown