显示修改

This commit is contained in:
xiekaidong 2023-04-25 15:49:24 +08:00
parent bbcf5c20ea
commit c1ed407a0f
4 changed files with 22 additions and 7 deletions

View File

@ -147,7 +147,7 @@ function BattleController:onLinkChange()
end
end
self.battleUI:refreshSkill(elementTypeMap)
self.battleUI:refreshSkill(elementTypeMap, true)
if mainElementType then
self.atkTeam:changeMainUnit(mainElementType)
end

View File

@ -532,7 +532,7 @@ function BattleUI:refreshDefHp(num, percent)
end
end
function BattleUI:refreshSkill(elementMap)
function BattleUI:refreshSkill(elementMap, showSfx)
if not self.skillNodeCells then
return
end
@ -541,7 +541,7 @@ function BattleUI:refreshSkill(elementMap)
if not self.skillNodeCells[elementType] then
return
end
self.skillNodeCells[elementType]:refresh(skillEntity, elementMap)
self.skillNodeCells[elementType]:refresh(skillEntity, elementMap, showSfx)
end
end
@ -737,9 +737,12 @@ function BattleUI:eliminationAni(sequence, callback)
if entity and entity:getCell() then
local baseObject = entity:getCell():getBaseObject()
baseObject:getTransform():SetAsLastSibling()
if entity:getSkillId() or info.noAni then
if info.noAni then
baseObject:setAnchoredPositionX(DEFAULT_X)
else
if entity:getSkillId() then
entity:getCell():hideSkillSfx()
end
self.eliminationAniSeq:Insert(index * 0.01, baseObject:getTransform():DOScale(1.3, 0.1))
self.eliminationAniSeq:InsertCallback(index * 0.01 + 0.2, function()
self:getSfxSmoke(index, function(obj)

View File

@ -156,6 +156,12 @@ function GridCell:showHighLight(show, mainElementType)
end
end
function GridCell:hideSkillSfx()
if self.outLineSfxObjs and self.outLineSfxObjs.skill then
self.outLineSfxObjs.skill:setActive(false)
end
end
function GridCell:resetTranform()
local uiMap = self:getUIMap()
self.baseObject:setLocalScale(1, 1, 1)

View File

@ -1,6 +1,6 @@
local SkillNodeCell = class("SkillNodeCell", BaseCell)
function SkillNodeCell:refresh(skillEntity, elementMap)
function SkillNodeCell:refresh(skillEntity, elementMap, showSfx)
local elementType = skillEntity:getPosition()
local add = 0
if elementMap and elementMap[elementType] then
@ -36,13 +36,19 @@ function SkillNodeCell:refresh(skillEntity, elementMap)
end
local effect = uiMap["skill_node_cell.icon_node.vfx_ui_battle_skill_full_b01"]
if value >= 1 then
if not self.lastValue then
self.lastValue = 0
end
if add > 0 and value == 1 and showSfx and self.lastValue < value then
effect:setVisible(true)
effect:stopAndClear()
effect:play()
else
if not showSfx then
effect:setVisible(false)
end
end
self.lastValue = value
end
return SkillNodeCell