diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua index cd1d6e9b84..c3338a3c99 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua @@ -215,27 +215,30 @@ function BattleLogic.TurnRound(debugTurn) -- 上一轮结束 BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundEnd, CurRound) end - CurRound = CurRound + 1 - CurCamp = BattleLogic.FirstCamp -- 判断先手阵营 - CurSkillPos[0] = 0 - CurSkillPos[1] = 0 - -- - BattleLogManager.Log( - "Round Change", - "round", CurRound - ) - -- 轮数变化 - BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundChange, CurRound) - -- 开始 - BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundStart, CurRound) - - -- 检测一次灵兽技能 SkillManager.CheckMonsterSkill(function() - --轮数变化后延时0.2秒用于初始化监听回合数被动的初始化 - BattleLogic.WaitForTrigger(0.2,function() - -- 进入新轮 - BattleLogic.CheckBattleLogic() + CurRound = CurRound + 1 + CurCamp = BattleLogic.FirstCamp -- 判断先手阵营 + CurSkillPos[0] = 0 + CurSkillPos[1] = 0 + -- + BattleLogManager.Log( + "Round Change", + "round", CurRound + ) + -- 轮数变化 + BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundChange, CurRound) + -- 开始 + BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundStart, CurRound) + + + -- 检测一次灵兽技能 + SkillManager.CheckMonsterSkill(function() + --轮数变化后延时0.2秒用于初始化监听回合数被动的初始化 + BattleLogic.WaitForTrigger(0.2,function() + -- 进入新轮 + BattleLogic.CheckBattleLogic() + end) end) end) else diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua index 4595212265..06de56ba3b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua @@ -96,11 +96,15 @@ end -- 检测是否需要等待灵兽技能 function this.CheckMonsterSkill(func) this.MonsterCheckFunc = func + -- 判断是否可以向下执行 if not this.IsSkilling and (not this.MonsterSkillList or #this.MonsterSkillList == 0) then + -- if this.MonsterCheckFunc then - this.MonsterCheckFunc() + local func = this.MonsterCheckFunc + -- 置空方法放到回调之前,避免再会调中再次调用检测方法导致方法被删除 + this.MonsterCheckFunc = nil + func() end - this.MonsterCheckFunc = nil end end