---@class WB_Countdown_C:UUserWidget ---@field TextBlock_ShowText UTextBlock ---@field TextBlock_Time UTextBlock --Edit Below-- local WB_Countdown = { bInitDoOnce = false; }; --[==[ Construct function WB_Countdown:Construct() end -- Construct ]==] function WB_Countdown:OnShowPanel(InShowTime, InText) if InShowTime then self.ShowTime = InShowTime else self.ShowTime = 3 end if InText then self.TextBlock_ShowText:SetText(InText) else self.TextBlock_ShowText:SetText("准备时间: ") end if self.ClockHandle then UGCEventSystem.StopTimer(self.ClockHandle) end self:UpdateShowTime() self.ClockHandle = UGCEventSystem.SetTimerLoop(self, self.UpdateShowTime, 1) end function WB_Countdown:UpdateShowTime() self.TextBlock_Time:SetText(tostring(self.ShowTime)) if self.ShowTime == 0 then SoundSystem.PlaySound(SoundSystem.ESound.GameStart) if self.ClockHandle then UGCEventSystem.StopTimer(self.ClockHandle) self.ClockHandle = nil WidgetManager:ClosePanel(WidgetConfig.EUIType.Countdown) end elseif self.ShowTime <= 3 then SoundSystem.PlaySound(SoundSystem.ESound.Clock) end self.ShowTime = self.ShowTime - 1 end -- function WB_Countdown:Tick(MyGeometry, InDeltaTime) -- end -- function WB_Countdown:Destruct() -- end return WB_Countdown;