---@class WB_BoltItem_C:UUserWidget ---@field Image_Icon UImage ---@field Image_Select UImage ---@field TextBlock_Count UTextBlock --Edit Below-- ---@type WB_BoltItem_C local WB_BoltItem = { bInitDoOnce = false } --[==[ Construct function WB_BoltItem:Construct() end -- Construct ]==] -- function WB_BoltItem:Tick(MyGeometry, InDeltaTime) -- end -- function WB_BoltItem:Destruct() -- end WB_BoltItem.BoltType = nil; function WB_BoltItem:SetBolt(InBolt) self.BoltType = InBolt.Bolt; UGCLogSystem.Log("[WB_BoltItem:SetBolt] Bolt Type = %s", TableHelper.printEnum(EBoltBuffType, self.BoltType)); UE.AsyncLoadObject_Cached(BoltInfo[InBolt.Bolt].Icon, function(TargetObject) self.Image_Icon:SetBrushFromTexture(TargetObject); -- 设置颜色 self.Image_Icon:SetColorAndOpacity(VectorHelper.ArrToColor(BoltInfo[InBolt.Bolt].Color)); end); self.TextBlock_Count:SetText(InBolt.Count); end function WB_BoltItem:SetSelect(IsSelect) if IsSelect then self.Image_Select:SetVisibility(ESlateVisibility.SelfHitTestInvisible); else self.Image_Select:SetVisibility(ESlateVisibility.Collapsed); end end function WB_BoltItem:SetBoltType(InBolt) self.BoltType = InBolt; UGCLogSystem.Log("[WB_BoltItem:SetBoltType] Bolt Type = %s", TableHelper.printEnum(EBoltBuffType, self.BoltType)); end function WB_BoltItem:GetBoltType() return self.BoltType; end return WB_BoltItem