2025-01-04 23:00:19 +08:00

71 lines
1.7 KiB
Lua

---@class WB_CountingGameShape_C:UUserWidget
---@field Moving UWidgetAnimation
---@field Image_Shape UImage
---@field TextBlock_Count UTextBlock
--Edit Below--
local WB_CountingGameShape = {
bInitDoOnce = false;
bMoving = false;
bIsHeart = false;
};
--[==[ Construct
function WB_CountingGameShape:Construct()
end
-- Construct ]==]
-- function WB_CountingGameShape:Tick(MyGeometry, InDeltaTime)
-- end
-- function WB_CountingGameShape:Destruct()
-- end
function WB_CountingGameShape:SetCount(InCount)
self.TextBlock_Count:SetText(tostring(InCount))
end
function WB_CountingGameShape:ShowCountText(IsShow)
if IsShow then
self.TextBlock_Count:SetVisibility(ESlateVisibility.SelfHitTestInvisible)
else
self.TextBlock_Count:SetVisibility(ESlateVisibility.Collapsed)
end
end
function WB_CountingGameShape:SetTexture(InTex)
UGCLogSystem.Log("[WB_CountingGameShape_SetTexture]")
self.Image_Shape:SetBrushFromTexture(InTex)
end
function WB_CountingGameShape:SetColor(InColor)
UGCLogSystem.Log("[WB_CountingGameShape_SetColor]")
self.Image_Shape:SetColorAndOpacity(InColor)
end
function WB_CountingGameShape:SetMoving()
if not self.bMoving then
self:PlayAnimation(self.Moving, 0, 0, EUMGSequencePlayMode.PingPong, 1)
self.bMoving = true
end
end
function WB_CountingGameShape:StopMove()
if self.bMoving then
-- self:JumpAnimation(self.Moving, 0)
self:StopAnimation(self.Moving)
self.bMoving = false
end
end
function WB_CountingGameShape:SetIsHeart(InIsHeart)
self.bIsHeart = InIsHeart
end
function WB_CountingGameShape:GetIsHeart()
return self.bIsHeart
end
return WB_CountingGameShape;