UGCProjects/GodOfWar/Script/UI/Tip/WB_Tip_Like.lua
2025-01-04 23:00:19 +08:00

47 lines
920 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---@class WB_Tip_Like_C:UUserWidget
---@field ShowTip UWidgetAnimation
---@field Border_SetTopTipsColor UBorder
---@field TextBlock_Num UTextBlock
--Edit Below--
---@type WB_Tip_3_C
local WB_Tip = {
bInitDoOnce = false;
LikeCount = 0;
LastAddTime = 0;
WaitTime = 10;
};
function WB_Tip:Construct()
end
-- function WB_Tip:Tick(MyGeometry, InDeltaTime)
-- end
-- function WB_Tip:Destruct()
-- end
function WB_Tip:AddTip()
UGCLogSystem.Log("[WB_Tip_AddTip] Like")
local NowTime = UGCSystemLibrary.GetGameTime()
if NowTime - self.LastAddTime <= self.WaitTime then
self.LikeCount = self.LikeCount + 1
else
self.LikeCount = 1
end
self.LastAddTime = NowTime
self.TextBlock_Num:SetText("×" .. self.LikeCount)
self:PlayAnimation(self.ShowTip, 0, 1, EUMGSequencePlayMode.Forward, 1.0)
UGCLogSystem.Log("[WB_Tip_AddTip] Like Finish")
end
-- [Editor Generated Lua] function define End;
return WB_Tip;