受击动画
This commit is contained in:
parent
c0237bd044
commit
3409aa046d
@ -732,7 +732,12 @@ function BattleUnitComp:playHurt()
|
||||
if self.hurtAniNameCount <= 0 then
|
||||
return
|
||||
end
|
||||
local name = self.hurtAniNameList[math.random(1, self.hurtAniNameCount)]
|
||||
local name = self.hurtNameList[1]
|
||||
if not name then
|
||||
name = self.hurtAniNameList[math.random(1, self.hurtAniNameCount)]
|
||||
else
|
||||
table.remove(self.hurtNameList, 1)
|
||||
end
|
||||
self.playSubAniTime = 0
|
||||
self.curHurtName = name
|
||||
if self.playSubAniDuration[name] == nil then
|
||||
@ -1450,6 +1455,8 @@ function BattleUnitComp:onSkillTakeEffect(skill, isFinalBlock, validEffectIdx)
|
||||
if isConditionPass then
|
||||
self.team:addHurtComboTag(BattleConst.COMBO_DEFAULT_POSITION)
|
||||
end
|
||||
-- 增加受击动画逻辑
|
||||
target:setHurtList(skill:getHitNameList())
|
||||
if self:takeEffect(effect, target, conditionResult) then
|
||||
if isConditionPass and skill:getComboPosition() then
|
||||
self.team:addHurtComboTag(skill:getComboPosition())
|
||||
@ -2264,4 +2271,9 @@ function BattleUnitComp:recycle()
|
||||
BattleHelper:recycleBattleHeroModel(self.modelId, self.baseObject)
|
||||
end
|
||||
|
||||
-- region
|
||||
function BattleUnitComp:setHurtList(hurtNameList)
|
||||
self.hurtNameList = table.refCopy(hurtNameList)
|
||||
end
|
||||
-- endregion
|
||||
return BattleUnitComp
|
||||
@ -461,4 +461,8 @@ function BattleSkillEntity:getIsHurtType()
|
||||
return self.isHurtType
|
||||
end
|
||||
|
||||
function BattleSkillEntity:getHitNameList()
|
||||
return self.skillInfo.name_hit or {}
|
||||
end
|
||||
|
||||
return BattleSkillEntity
|
||||
Loading…
x
Reference in New Issue
Block a user