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 (!storyBattleField.RequestFight())
|
{
|
autoNext = true;
|
}
|
}
|
|
|
}
|