diff --git a/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroAndEquipListPanel.lua b/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroAndEquipListPanel.lua index 4c32247726..bc13ef1ddc 100644 --- a/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroAndEquipListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/HandBook/HandBookHeroAndEquipListPanel.lua @@ -102,7 +102,8 @@ function HandBookHeroAndEquipListPanel:InitComponent() self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform) self.selectBtn = Util.GetGameObject(self.gameObject, "Tabs/selectBtn") - for i = 0, 6 do + Util.GetGameObject(self.transform, "Tabs/grid/Btn" .. 0):SetActive(false) + for i = 1, 6 do tabs[i] = Util.GetGameObject(self.transform, "Tabs/grid/Btn" .. i) end self.Tabs = Util.GetGameObject(self.gameObject, "Tabs") @@ -114,7 +115,7 @@ function HandBookHeroAndEquipListPanel:BindEvent() Util.AddClick(self.btnBack, function() self:ClosePanel() end) - for i = 0, 6 do + for i = 1, 6 do Util.AddClick(tabs[i], function() if i == proId then proId=ProIdConst.All @@ -709,11 +710,8 @@ end function HandBookHeroAndEquipListPanel:SetSelectBtn() PlayerManager.headBookListTag = proId -- self.selectBtn:SetActive(proId ~= ProIdConst.All) - if proId ~= ProIdConst.All then - self.selectBtn.transform.localPosition = tabs[proId].transform.localPosition - else - self.selectBtn.transform.localPosition = Vector3.New(-336, 0, 0) - end + self.selectBtn.transform:SetParent(tabs[proId].transform) + self.selectBtn.transform.localPosition = Vector3.zero end function HandBookHeroAndEquipListPanel:SortHeroNatural(heroList) table.sort(heroList, function(a, b)