【战斗】优化身外化身casting显示时间

dev_chengFeng
gaoxin 2021-12-14 13:51:41 +08:00
parent 82ced48859
commit 1691fd03da
3 changed files with 27 additions and 11 deletions

View File

@ -35,6 +35,14 @@ end
--++++++++++++++DelayFunc 延迟执行方法
function BattleUnit:DelayFunc(time, func)
-- 判断是否需要延时
if not time or time <= 0 then
if func then
func()
end
return
end
--
if not self._DelayFuncList then
self._DelayFuncList = {}
end

View File

@ -144,9 +144,6 @@ end
-- 播放动画
function MonsterView:PlaySpineAnim(gog, time, name, isLoop)
if self.isMainPlayer then
name = "idle"
end
if isLoop then
gog.AnimationState:SetAnimation(time, name, isLoop)
else
@ -262,8 +259,15 @@ function MonsterView:OnSkillCastingStart(skill)
coroutine.wait(0.1)
self.turnEffect:SetActive(true)
end)
-- 延长Casting时间
return 0.6
else
self:PlaySpineAnim(self.RoleLiveGOGraphic2, 0, "attack" , false)
if self.isMainPlayer then
self:PlaySpineAnim(self.RoleLiveGOGraphic2, 0, "idle" , false)
else
self:PlaySpineAnim(self.RoleLiveGOGraphic2, 0, "attack" , false)
end
end

View File

@ -135,17 +135,21 @@ function SkillCaster:PlaySkillCastingEffect(combat, skill, func)
self.owner:OnSkillCastStart(skill)
end
-- 调用上层接口
local _ExtraTime
if self.owner.OnSkillCastingStart then
self.owner:OnSkillCastingStart()
_ExtraTime = self.owner:OnSkillCastingStart()
end
_ExtraTime = _ExtraTime or 0
self.owner:DelayFunc(2, function()
self.castingEfectNode:SetActive(false)
-- 调用上层接口
if self.owner.OnSkillCastingEnd then
self.owner:OnSkillCastingEnd()
end
-- 判断是否要额外增加casting显示时间
self.owner:DelayFunc(_ExtraTime, function ()
self.castingEfectNode:SetActive(false)
-- 调用上层接口
if self.owner.OnSkillCastingEnd then
self.owner:OnSkillCastingEnd()
end
end)
if func then func() func = nil end
end)