每次切换至神魂页面时,自动滑动至已激活的最高神魂等级所在区域,

dev_chengFeng
jiaoyangna 2021-10-27 18:28:07 +08:00
parent 82d0e28baa
commit f71c604cb2
1 changed files with 9 additions and 1 deletions

View File

@ -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()