yyl
2 天以前 6bcbcf0494eceb60e2754c966d66bd531c5be2a9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 (!storyBattleField.RequestFight())
        {
            autoNext = true;
        }
    }
 
 
}