2020-07-04 14:41:25 +08:00
|
|
|
|
-- xx单元
|
2020-08-02 08:47:44 +08:00
|
|
|
|
local _cell = {}
|
|
|
|
|
|
local csSelf = nil
|
|
|
|
|
|
local transform = nil
|
|
|
|
|
|
local mData = nil
|
|
|
|
|
|
local uiobjs = {}
|
2020-07-04 14:41:25 +08:00
|
|
|
|
|
2020-08-02 08:47:44 +08:00
|
|
|
|
-- 初始化,只调用一次
|
|
|
|
|
|
function _cell.init(csObj)
|
|
|
|
|
|
csSelf = csObj
|
|
|
|
|
|
transform = csSelf.transform
|
|
|
|
|
|
--[[
|
2020-07-04 14:41:25 +08:00
|
|
|
|
上的组件:getChild(transform, "offset", "Progress BarHong"):GetComponent("UISlider");
|
|
|
|
|
|
--]]
|
2020-08-02 08:47:44 +08:00
|
|
|
|
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
|
|
|
|
|
end
|
2020-07-04 14:41:25 +08:00
|
|
|
|
|
2020-08-02 08:47:44 +08:00
|
|
|
|
-- 显示,
|
|
|
|
|
|
-- 注意,c#侧不会在调用show时,调用refresh
|
|
|
|
|
|
function _cell.show(go, data)
|
|
|
|
|
|
mData = data
|
|
|
|
|
|
uiobjs.Label.text = mData.name
|
|
|
|
|
|
if mData.isDev == 1 then
|
|
|
|
|
|
uiobjs.Label.color = Color.red
|
|
|
|
|
|
else
|
|
|
|
|
|
uiobjs.Label.color = Color.white
|
2020-07-04 14:41:25 +08:00
|
|
|
|
end
|
2020-08-02 08:47:44 +08:00
|
|
|
|
end
|
2020-07-04 14:41:25 +08:00
|
|
|
|
|
2020-08-02 08:47:44 +08:00
|
|
|
|
-- 取得数据
|
|
|
|
|
|
function _cell.getData()
|
|
|
|
|
|
return mData
|
2020-07-04 14:41:25 +08:00
|
|
|
|
end
|
2020-08-02 08:47:44 +08:00
|
|
|
|
|
|
|
|
|
|
--------------------------------------------
|
|
|
|
|
|
return _cell
|