39 lines
975 B
Lua
39 lines
975 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
|
|||
|
|
--[[
|
|||
|
|
上的组件:getChild(transform, "offset", "Progress BarHong"):GetComponent("UISlider");
|
|||
|
|
--]]
|
|||
|
|
uiobjs.sprite = csSelf:GetComponent("UISprite")
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- 显示,
|
|||
|
|
-- 注意,c#侧不会在调用show时,调用refresh
|
|||
|
|
function _cell.show(go, data)
|
|||
|
|
mData = data
|
|||
|
|
if mData.value then
|
|||
|
|
uiobjs.sprite.color = ColorEx.getColor(0xffFFC000)
|
|||
|
|
CLUIUtl.setSpriteFit(uiobjs.sprite, "cust_full_star")
|
|||
|
|
else
|
|||
|
|
uiobjs.sprite.color = ColorEx.getColor(0xffd9d9d9)
|
|||
|
|
CLUIUtl.setSpriteFit(uiobjs.sprite, "cust_star")
|
|||
|
|
end
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- 取得数据
|
|||
|
|
function _cell.getData()
|
|||
|
|
return mData
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
--------------------------------------------
|
|||
|
|
return _cell
|