diff --git a/lua/app/ui/hero/hero_info_comp.lua b/lua/app/ui/hero/hero_info_comp.lua index d4e00ced..e1b56c4d 100644 --- a/lua/app/ui/hero/hero_info_comp.lua +++ b/lua/app/ui/hero/hero_info_comp.lua @@ -32,6 +32,7 @@ function HeroInfoComp:init() self.upgrade = uiMap["hero_info.up"] self.bgElement = uiMap["hero_detail_ui.bg.element_bg"] self.btnAttr = uiMap["hero_info.bg_6.btn_attr"] + self.fragmentNode = uiMap["hero_detail_ui.bg.fragment_bg"] self.skill = {} self.skillIcon = {} @@ -67,6 +68,8 @@ function HeroInfoComp:refresh(checkLevel) local isLvChange = checkLevel and self.curLevel ~= self.heroEntity:getLv() self.txLv:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, self.heroEntity:getLv())) + local lvTxW = self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth + self.txLv:setSizeDeltaX(lvTxW) self.spineObjAvatar:getSkeletonGraphic().enabled = false self.spineObjAvatar:loadAssetAsync(self.heroEntity:getModelId(), function() @@ -188,9 +191,14 @@ function HeroInfoComp:refresh(checkLevel) if self.onlyLook then -- 仅查看的不显示升级和激活按钮 self.upgrade:setVisible(false) self.baseObject:setSizeDeltaY(SIZE_DELTA_Y_LOOK) + self.fragmentNode:setVisible(false) + self.spineObjLv:setVisible(false) + self.txLv:setAnchoredPositionX(lvTxW / 2) else self.upgrade:setVisible(true) self.baseObject:setSizeDeltaY(SIZE_DELTA_Y_HERO) + self.txLv:setAnchoredPositionX(-44) + self.fragmentNode:setVisible(true) end end