From f71c604cb22536b64c87f459e4343ea2952133af Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Wed, 27 Oct 2021 18:28:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=AC=A1=E5=88=87=E6=8D=A2=E8=87=B3?= =?UTF-8?q?=E7=A5=9E=E9=AD=82=E9=A1=B5=E9=9D=A2=E6=97=B6=EF=BC=8C=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=BB=91=E5=8A=A8=E8=87=B3=E5=B7=B2=E6=BF=80=E6=B4=BB?= =?UTF-8?q?=E7=9A=84=E6=9C=80=E9=AB=98=E7=A5=9E=E9=AD=82=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E6=89=80=E5=9C=A8=E5=8C=BA=E5=9F=9F=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/RoleInfo/RoleGodSoulLayout.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGodSoulLayout.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGodSoulLayout.lua index 82cac29365..2c72bc9274 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGodSoulLayout.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGodSoulLayout.lua @@ -19,7 +19,7 @@ function RoleGodSoulLayout:InitComponent() self.costPre = Util.GetGameObject(self.gameObject,"bgdi/costPre") self.singlePre = Util.GetGameObject(self.gameObject,"bgdi/singlePre") self.grid = Util.GetGameObject(self.gameObject,"bgdi/scroll/grid") - + self.gridPos = self.grid:GetComponent("RectTransform").anchoredPosition self.gridList = {} end @@ -50,6 +50,14 @@ function RoleGodSoulLayout:SetData(_sortinglayer,_parent,_curHerodata,_isUpZhen, self.isUpZhen = _isUpZhen self.herodatas = _heroDatas self:UpdateGodList() + local pos = Vector3.New(self.gridPos.x,self.gridPos.y,self.gridPos.z) + for i = 1,self.lv do + pos.y = pos.y + GetPreferredHeight(self.gridList[i].go.transform) + end + local pos1 = self.grid:GetComponent("RectTransform").anchoredPosition + if pos1.y ~= pos.y then + self.grid:GetComponent("RectTransform").anchoredPosition = pos + end end function RoleGodSoulLayout:UpdateGodList()