小游戏提交
parent
04e6c2fb42
commit
9a53f20f60
|
@ -33,30 +33,15 @@ function this.Show()
|
|||
--设置按钮和图片
|
||||
for index, answerId in pairs(aIdList) do
|
||||
if not _itemsList[index] then
|
||||
|
||||
_itemsList[index] = newObjToParent(this.itemPre, this.itemsLayout)
|
||||
local icon = Util.GetGameObject(_itemsList[index], "icon"):GetComponent("Image")
|
||||
local btnSure = Util.GetGameObject(_itemsList[index], "btnAns")
|
||||
local data = ConfigManager.GetConfigDataByKey(ConfigName.HeroConfig,"Id",tonumber(answerId))
|
||||
|
||||
-- if not _iconList[index] then
|
||||
-- _iconList[index] = SubUIManager.Open(SubUIConfig.ItemView,icon.transform)
|
||||
-- end
|
||||
-- _iconList[index]:OnOpen(false,{answerId,1},1.1,false)
|
||||
|
||||
if not _iconList[index] then
|
||||
_iconList[index] = icon
|
||||
end
|
||||
_iconList[index].sprite = Util.LoadSprite(GetResourcePath(data.Icon))
|
||||
|
||||
Util.AddOnceClick(btnSure, function()
|
||||
this.ChooseAnswer(index)
|
||||
end)
|
||||
end
|
||||
_itemsList[index]:SetActive(true)
|
||||
|
||||
Util.GetGameObject(_itemsList[index], "btnAns/name"):GetComponent("Text").text = this.heroConfig[tonumber(answerId)].ReadingName
|
||||
|
||||
local data = ConfigManager.GetConfigDataByKey(ConfigName.HeroConfig,"Id",tonumber(answerId))
|
||||
Util.GetGameObject(_itemsList[index], "icon"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(data.Icon))
|
||||
Util.GetGameObject(_itemsList[index], "btnAns/name"):GetComponent("Text").text = data.ReadingName
|
||||
Util.AddOnceClick(Util.GetGameObject(_itemsList[index], "btnAns"), function()
|
||||
this.ChooseAnswer(index)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue