This commit is contained in:
2020-07-04 14:41:25 +08:00
parent 70c346d2c1
commit a8f02e4da5
3748 changed files with 587372 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
-- 界面元素对象
local csSelf = nil
local transform = nil
local Label
local ProgressBar
-- 属性值变量
local mData = nil
local uiCell = {}
function uiCell.init(go)
transform = go.transform
csSelf = transform:GetComponent("CLCellLua")
Label = getChild(transform, "Label"):GetComponent("UILabel")
ProgressBar = getChild(transform, "Progress Bar"):GetComponent("UISlider")
end
function uiCell.show(go, data)
mData = data
NGUITools.SetActive(ProgressBar.gameObject, true)
Label.text = ""
InvokeEx.cancelInvokeByUpdate(uiCell.refresh)
uiCell.refresh()
end
function uiCell.refresh()
if (mData == nil or mData.www == nil) then
NGUITools.SetActive(ProgressBar.gameObject, false)
Label.text = ""
return
end
-- Label.text = PStr.b():a(mData.url):a("..."):a(mData.www.progress*100):a("%"):e()
Label.text = PStr.b():a(math.floor(mData.www.downloadProgress * 100)):a("%"):e()
ProgressBar.value = mData.www.downloadProgress
InvokeEx.invokeByUpdate(uiCell.refresh, 0.02)
end
function uiCell.OnDisable()
InvokeEx.cancelInvokeByUpdate(uiCell.refresh)
end
function uiCell.getdata()
return mData, uiCell
end
------------------------------------
return uiCell