33 lines
828 B
Lua
33 lines
828 B
Lua
-- 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
|
||
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
||
uiobjs.ButtonDel = getChild(transform, "ButtonDel").gameObject
|
||
uiobjs.SpriteIcon = getCC(transform, "SpriteIcon", "UISprite")
|
||
end
|
||
|
||
-- 显示,
|
||
-- 注意,c#侧不会在调用show时,调用refresh
|
||
function _cell.show(go, data)
|
||
mData = data
|
||
uiobjs.Label.text = mData.name
|
||
--//TODO:权限判断,如果有权限的可以考虑直接显示图片
|
||
end
|
||
|
||
-- 取得数据
|
||
function _cell.getData()
|
||
return mData
|
||
end
|
||
|
||
--------------------------------------------
|
||
return _cell
|