2020-07-18 21:12:14 +08:00
|
|
|
|
-- xx单元
|
|
|
|
|
|
local _cell = {}
|
|
|
|
|
|
---@type Coolape.CLCellLua
|
|
|
|
|
|
local csSelf = nil
|
|
|
|
|
|
local transform = nil
|
|
|
|
|
|
local mData = nil
|
|
|
|
|
|
local uiobjs = {}
|
|
|
|
|
|
|
|
|
|
|
|
-- 初始化,只调用一次
|
|
|
|
|
|
function _cell.init(csObj)
|
|
|
|
|
|
csSelf = csObj
|
|
|
|
|
|
transform = csSelf.transform
|
|
|
|
|
|
---@type UIWidget
|
|
|
|
|
|
uiobjs.widget = csSelf:GetComponent("UIWidget")
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- 显示,
|
|
|
|
|
|
-- 注意,c#侧不会在调用show时,调用refresh
|
|
|
|
|
|
function _cell.show(go, data)
|
|
|
|
|
|
mData = data
|
2020-07-20 22:20:21 +08:00
|
|
|
|
uiobjs.widget.height = mData.attr.height or 40
|
2020-07-18 21:12:14 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- 取得数据
|
|
|
|
|
|
function _cell.getData()
|
|
|
|
|
|
return mData
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------
|
|
|
|
|
|
return _cell
|