diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BattleUnit.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BattleUnit.lua index d942d0ff7b..c3f48c1729 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BattleUnit.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BattleUnit.lua @@ -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 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua index 60434820bc..2926430d43 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua @@ -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 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua index 0b852e739b..377261690f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua @@ -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)