2023-07-14 19:35:33 +00:00
|
|
|
local XUiDormPersonAttDesItem = XClass(nil, "XUiDormPersonAttDesItem")
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
function XUiDormPersonAttDesItem:Ctor(ui)
|
2023-07-14 19:35:33 +00:00
|
|
|
self.GameObject = ui.gameObject
|
|
|
|
self.Transform = ui.transform
|
|
|
|
XTool.InitUiObject(self)
|
|
|
|
end
|
|
|
|
|
|
|
|
-- 更新数据
|
|
|
|
function XUiDormPersonAttDesItem:OnRefresh(txt, icon)
|
|
|
|
self.TxtDes.text = txt
|
2024-09-01 20:49:41 +00:00
|
|
|
if not icon then
|
2023-07-14 19:35:33 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
self.ImgDes:SetSprite(icon)
|
2023-07-14 19:35:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function XUiDormPersonAttDesItem:SetState(state)
|
|
|
|
if not self.GameObject then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
self.GameObject:SetActive(state)
|
|
|
|
end
|
|
|
|
|
|
|
|
return XUiDormPersonAttDesItem
|