多段伤害音效
This commit is contained in:
parent
7151a033d7
commit
fd4b60dfd2
@ -1402,7 +1402,17 @@ function BattleUnitComp:onSkillTakeEffect(skill, isFinalBlock, validEffectIdx)
|
||||
end
|
||||
local soundHit = skill:getSoundHit()
|
||||
if soundHit then
|
||||
BattleHelper:playSkillSound(soundHit, 0)
|
||||
local blocks = skill:getEffectBlock()
|
||||
if blocks then
|
||||
local soundIndex = 1
|
||||
for i, endIdx in ipairs(blocks) do
|
||||
if endIdx == effectEndIdx then
|
||||
soundIndex = i
|
||||
break
|
||||
end
|
||||
end
|
||||
BattleHelper:playSkillSound(soundHit[soundIndex], 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -242,7 +242,7 @@ function BattleHelper:recycleBuffEffect(buffEffect)
|
||||
end
|
||||
|
||||
function BattleHelper:playSkillSound(name, delay)
|
||||
if self.skillSoundPath == nil then
|
||||
if self.skillSoundPath == nil or not name then
|
||||
return
|
||||
end
|
||||
local soundFullPath = self.skillSoundPath[name]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user