防具升级刷新不及时fix

This commit is contained in:
Fang 2023-08-01 14:45:49 +08:00
parent 536cc1dfc3
commit 2d139dd23f

View File

@ -68,9 +68,6 @@ end
function ArmorInfoComp:setHeroData(heroEntity)
self.heroEntity = heroEntity
self.selectPart = self.selectPart or GConst.EquipConst.PART_TYPE.HAT
self:bind(DataManager.EquipData:getEquip(self.heroEntity:getCfgId(), self.selectPart), "isDirty", function()
self:refresh()
end)
end
function ArmorInfoComp:refresh()
@ -79,6 +76,10 @@ end
function ArmorInfoComp:onSelectIdx(index)
self.selectPart = ARMOR_PART_INDEX[index]
self:bind(DataManager.EquipData:getEquip(self.heroEntity:getCfgId(), self.selectPart), "isDirty", function()
self:refresh()
end)
self:refreshSelectArmor()
for index, value in ipairs(self.armor) do