刷新UI方法

来源:互联网 发布:arm模拟器 windows 编辑:程序博客网 时间:2024/04/30 00:41
if(self.mItem ==nil and self.mItemParent ==nil) thenreturnendlocal list = ArenaManager.getRewardDataList()local count = 1for k,v in pairs(list) dolocal tmpObj = nillocal tmpCom = nillocal itemcount = table.getCount(self.m_ItemList)if(count > itemcount) thentmpObj = AddChild(self.mItem.gameObject,self.mItemParent.gameObject)tmpCom = UIRewardItem:Create(tmpObj,self.mbehaviour,self.OnItemInfoClick,self)local itObj = {}itObj["object"] = tmpObjitObj["script"] =  tmpComself.m_ItemList[count] = itObjelsetmpObj = self.m_ItemList[count]["object"]tmpCom = self.m_ItemList[count]["script"]endif tmpObj ~= nil thenSetActive(tmpObj,true)if tmpCom ~= nil thentmpCom:freshData(v)endendcount = count + 1endfor k = count,#self.m_ItemList doif self.m_ItemList[k] == nil thenreturnendSetActive(self.m_ItemList[k]["object"],false)endrefreshScrollRect(self.m_ScrollRect)

0 0
原创粉丝点击