***转载请注明出处:http://blog.youkuaiyun.com/nnsword
q.LoadChannelGroupDQ("LUA07 - Box.cgr", "Box",0, "DownloadProgress")
功能:动态加载组文件
参数:1-文件路径,2-目标池,3-目标池中索引,4-进度条对象名称
q.RemoveChannelGroup("Box",0)
功能:卸载组
参数:1-池名称,2-池中索引
local progress = q.GetDQProgress(DownloadProgress)
功能:取得进行条当前进度
参数:1-进度条对象(对象的名称)
值的范围:0~1
应用场景:动态加载组,此组不需要打包到发布包中
--组对象加载
function CallChannel()
-- Load Group and track progress via DownloadProgress batch
q.LoadChannelGroupDQ("LUA07 - Box.cgr", "Box",0, "DownloadProgress")
end
--取得加载进度
function GetValue()
-- get the progress value of the DownloadProgress batch
local progress = q.GetDQProgress(DownloadProgress)
return progress
end
--组对象卸载
function CallChannel()
-- Define child
local ProgressChannel = channel.GetChild(0)
-- Remove Group
q.RemoveChannelGroup("Box",0)
-- Reset progess value
ProgressChannel:SetValue(0)
end