【神将详情】根据魂印的显示修改界面的大小

dev_chengFeng
gaoxin 2022-01-06 12:03:35 +08:00
parent c8b604bde4
commit 7c0726e5b9
1 changed files with 16 additions and 2 deletions

View File

@ -22,6 +22,8 @@ function RoleInfoPopup:InitComponent()
this.content = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content"):GetComponent("RectTransform")
this.backBtn = Util.GetGameObject(self.transform, "Panel/BackBtn")
this.bg = Util.GetGameObject(self.transform, "Panel/BG")
this.sc = Util.GetGameObject(self.transform, "Panel/Scroll View")
this.roleInfo0 = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/RoleInfo0")
this.head = Util.GetGameObject(this.roleInfo0, "Head")
@ -463,13 +465,25 @@ end
function this.SoulPrintInfo()
local curHeroSoulPrintDatas = {}
this.soulPrintInfo.gameObject:SetActive(#curHeroData.soulPrintList~=0)
-- 没有魂印不显示
if #curHeroData.soulPrintList==0 then
this.soulPrintInfo.gameObject:SetActive(false)
this.backBtn.transform.localPosition = Vector2.New(432.5, 590)
this.bg.transform.sizeDelta = Vector2.New(935, 1250)
this.sc.transform.sizeDelta = Vector2.New(935, 1132)
return
end
this.soulPrintInfo.gameObject:SetActive(true)
this.backBtn.transform.localPosition = Vector2.New(432.5, 690)
this.bg.transform.sizeDelta = Vector2.New(935, 1450)
this.sc.transform.sizeDelta = Vector2.New(935, 1332)
for key, value in pairs(soulPrintPreList) do
if value then
value:SetActive(false)
end
end
if #curHeroData.soulPrintList==0 then return end
for i,v in pairs(curHeroData.soulPrintList) do --生成预设
if not soulPrintPreList[i] then