diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/HeroPreviewPanel.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/HeroPreviewPanel.lua index 5c95de60a0..e8d0e526bf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/HeroPreviewPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/HeroPreviewPanel.lua @@ -203,26 +203,43 @@ function this.SwitchView(index) this.List2[i].gameObject:SetActive(true) end end - + for i = 1, #this.List3 do + if this.List3[i] then + this.List3[i].gameObject:SetActive(false) + end + end for i = 1, #threeData do if not this.List3[i] then this.List3[i] = SubUIManager.Open(SubUIConfig.ItemView,this.threeGrid.transform) + this.List3[i].gameObject:SetActive(true) end this.List3[i]:OnOpen(false, {threeData[i].Reward[1], threeData[i].Reward[2]}, 1.1, true) this.List3[i].name:GetComponent("Text").text=""..string.format("%.2f", (threeData[i].Weight/100000)*100) .."%" this.List3[i].gameObject:SetActive(true) end + for i = 1, #this.List4 do + if this.List4[i] then + this.List4[i].gameObject:SetActive(false) + end + end for i = 1, #fourData do if not this.List4[i] then this.List4[i] = SubUIManager.Open(SubUIConfig.ItemView,this.fourGrid.transform) + this.List4[i].gameObject:SetActive(true) end this.List4[i]:OnOpen(false, {fourData[i].Reward[1], fourData[i].Reward[2]}, 1.1, true) this.List4[i].name:GetComponent("Text").text=""..string.format("%.2f", (fourData[i].Weight/100000)*100) .."%" this.List4[i].gameObject:SetActive(true) end + for i = 1, #this.List5 do + if this.List5[i] then + this.List5[i].gameObject:SetActive(false) + end + end for i = 1, #fiveData do if not this.List5[i] then this.List5[i] = SubUIManager.Open(SubUIConfig.ItemView,this.fiveGrid.transform) + this.List5[i].gameObject:SetActive(true) end this.List5[i]:OnOpen(false, {fiveData[i].Reward[1], fiveData[i].Reward[2]}, 1.1, true) this.List5[i].name:GetComponent("Text").text=""..string.format("%.2f", (fiveData[i].Weight/100000)*100) .."%"