UGCProjects/GZJ/Script/UI/Notice/WBP_RespawnNotice.lua
2025-01-08 22:46:12 +08:00

53 lines
1.3 KiB
Lua

---@class WBP_RespawnNotice_C:WBP_NoticeBase_C
---@field FadeOut UWidgetAnimation
---@field FadeIn UWidgetAnimation
---@field TextBlock_RespawnRemainTime UTextBlock
--Edit Below--
local NoticeBase = require('Script.UI.Notice.WBP_NoticeBase')
local WBP_RespawnNotice = setmetatable(
{
bInitDoOnce = false,
RemainRespawnTime = -1,
},
{
__index = NoticeBase,
__metatable = NoticeBase
}
);
function WBP_RespawnNotice:Construct()
WBP_RespawnNotice.SuperClass.Construct(self)
end
function WBP_RespawnNotice:Tick(MyGeometry, InDeltaTime)
if self.RemainRespawnTime >= 0.0 then
self.RemainRespawnTime = self.RemainRespawnTime - InDeltaTime
self.TextBlock_RespawnRemainTime:SetText(tostring(math.ceil(self.RemainRespawnTime)))
else
self.bCanEverTick = false
return
end
end
function WBP_RespawnNotice:InitNoticeFromParam(InParams)
if type(InParams) ~= "table" then
return
end
local Type = type(InParams.Time)
if Type == 'string' or Type == 'number' then
self.RemainRespawnTime = tonumber(InParams.Time)
self.bCanEverTick = true
end
end
function WBP_RespawnNotice:GetEnterAnimation()
return self.FadeIn
end
function WBP_RespawnNotice:GetExitAnimation()
return self.FadeOut
end
return WBP_RespawnNotice;