lcy
2025-10-17 08d180d4dee2015a09e1be660cbbf35720fd78bc
Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs
@@ -1,30 +1,39 @@
using UnityEngine;
//   只有主线战斗用到 所以这里可能会放一些主线的特殊处理
public class HandModeOperationAgent : IOperationAgent
{
   protected StoryBattleField storyBattleField;
   bool autoNext = false;   //预存玩家的下一次攻击,让下一次自动执行,因为玩家点的时机不一定是刚好的可攻击状态
   public HandModeOperationAgent(BattleField battleField) : base(battleField)
   {
      storyBattleField = battleField as StoryBattleField;
   }
   public override void Run()
   {
      base.Run();
      if (autoNext)
      {
         if (storyBattleField.RequestFight())
         {
            //直到成功为止
            autoNext = false;
         }
      }
   }
   //   通过主界面的按钮推动(调用)DoNext
   public override void DoNext()
   {
      base.DoNext();
      if (!battleField.recordPlayer.IsPlaying())
      if (!storyBattleField.RequestFight())
      {
         //   ask for next action
      }
      else
      {
         Debug.LogError("action doesnt finish, wait a moment please");
         autoNext = true;
      }
   }
}