46 lines
1.3 KiB
Lua
Raw Normal View History

2025-01-04 23:00:19 +08:00
---@class WB_TimeStateTip_C:TopTipWidget
---@field DX_Out UWidgetAnimation
---@field DX_In UWidgetAnimation
---@field Border_Main UBorder
---@field Border_TopTips UCanvasPanel
---@field ProgressBar_Time UProgressBar
---@field AnimationPlay UWidgetAnimation
---@field NeedTickFadeout bool
---@field AnimationTime float
--Edit Below--
local WB_TimeStateTip = {
bInitDoOnce = false;
bShowing = false
}
function WB_TimeStateTip:Construct()
self.Border_Main:SetContentColorAndOpacity({R = 1, G = 1, B = 1, A = 0})
end
function WB_TimeStateTip:Tick(MyGeometry, InDeltaTime)
local StartHuntTime = UGCGameSystem.GameState:GetStartHuntTime()
local ServerGameTime = UGCGameSystem.GameState:GetServerGameTime()
local HuntTime = ServerGameTime - StartHuntTime
if self.bShowing then
self.ProgressBar_Time:SetPercent(1 - HuntTime / ProjectConfig.HuntingDuration)
if HuntTime > ProjectConfig.HuntingDuration then
self:PlayAnimation(self.DX_Out, 0, 1, EUMGSequencePlayMode.Forward, 1.0)
self.bShowing = false
end
else
if HuntTime < ProjectConfig.HuntingDuration then
self:PlayAnimation(self.DX_In, 0, 1, EUMGSequencePlayMode.Forward, 1.0)
self.bShowing = true
end
end
end
-- function WB_TimeStateTip:Destruct()
-- end
return WB_TimeStateTip