技能特效

This commit is contained in:
xiekaidong 2023-04-24 21:03:39 +08:00
parent 405aad10f7
commit 4acf0850f8

View File

@ -20,7 +20,8 @@ function SkillNodeCell:refresh(skillEntity, elementMap)
end end
local curEnergy = skillEntity:getEnergy() + add local curEnergy = skillEntity:getEnergy() + add
local needEnergy = skillEntity:getNeedEnergy() local needEnergy = skillEntity:getNeedEnergy()
self.imgComp.fillAmount = curEnergy / needEnergy local value = curEnergy / needEnergy
self.imgComp.fillAmount = value
if self.lastSkillIcon ~= skillEntity:getBattleIcon() then if self.lastSkillIcon ~= skillEntity:getBattleIcon() then
self.lastSkillIcon = skillEntity:getBattleIcon() self.lastSkillIcon = skillEntity:getBattleIcon()
uiMap["skill_node_cell.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL, self.lastSkillIcon) uiMap["skill_node_cell.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL, self.lastSkillIcon)
@ -33,6 +34,15 @@ function SkillNodeCell:refresh(skillEntity, elementMap)
self.lastElementType = elementType self.lastElementType = elementType
uiMap["skill_node_cell.match_bg"]:setSprite(GConst.ATLAS_PATH.BATTLE, GConst.BattleConst.SKILL_ELEMENT_BG[elementType]) uiMap["skill_node_cell.match_bg"]:setSprite(GConst.ATLAS_PATH.BATTLE, GConst.BattleConst.SKILL_ELEMENT_BG[elementType])
end end
local effect = uiMap["skill_node_cell.icon_node.vfx_ui_battle_skill_full_b01"]
if value >= 1 then
effect:setVisible(true)
effect:stopAndClear()
effect:play()
else
effect:setVisible(false)
end
end end
return SkillNodeCell return SkillNodeCell