| | |
| | | public class BattleField |
| | | { |
| | | public Action<int, int> OnRoundChange; |
| | | public Action<bool> OnBattlePause; |
| | | |
| | | public Action<float> OnSpeedRatioChange; // 添加战斗速度变化的回调 |
| | | |
| | | public Action OnBattleRun; // 添加战斗运行时的回调 |
| | | |
| | | public BattleObjMgr battleObjMgr; |
| | | |
| | | public BattleEffectMgr battleEffectMgr; |
| | | |
| | | public BattleTweenMgr battleTweenMgr; |
| | | |
| | | public RecordPlayer recordPlayer; |
| | | |
| | | public IOperationAgent operationAgent; |
| | | |
| | | public byte turnMax; |
| | | |
| | | public int round = 0; |
| | | |
| | | public string guid = string.Empty;//等于string.Empty的时候代表是StoryBattleField 是主线副本 |
| | | |
| | | public string guid = string.Empty; |
| | | public int MapID = 0; |
| | | |
| | | public int FuncLineID = 0; |
| | | |
| | | public float speedRatio = 1.1f; |
| | | |
| | | public JsonData extendData; |
| | | |
| | | public bool IsBattleFinish |
| | | { |
| | | get; |
| | | protected set; |
| | | } |
| | | |
| | | public bool IsBattleFinish { get; protected set; } |
| | | public bool rejectNewPackage = false; |
| | | |
| | | private bool m_IsPause = false; |
| | | |
| | | public bool IsPause |
| | | { |
| | | get |
| | | { |
| | | return m_IsPause; |
| | | } |
| | | get { return m_IsPause; } |
| | | set |
| | | { |
| | | |
| | | if (value) |
| | | { |
| | | m_IsPause = value; |
| | |
| | | } |
| | | |
| | | public BattleRootNode battleRootNode; |
| | | |
| | | private BattleMode battleMode; |
| | | public event Action<BattleMode> ChangeBattleModeEvent; |
| | | |
| | | public Action<bool> OnBattlePause; |
| | | |
| | | protected List<TeamBase> redTeamList = null; |
| | | |
| | | protected List<TeamBase> blueTeamList = null; |
| | | |
| | | protected int redTeamIndex = 0; |
| | | |
| | | protected int blueTeamIndex = 0; |
| | | |
| | | public BattleField(string _guid) |
| | |
| | | |
| | | public void SetSpeedRatio(float ratio) |
| | | { |
| | | bool isChange = speedRatio != ratio; |
| | | speedRatio = ratio; |
| | | battleObjMgr.SetSpeedRatio(ratio); |
| | | recordPlayer.SetSpeedRatio(ratio); |
| | | battleEffectMgr.SetSpeedRatio(ratio); |
| | | battleTweenMgr.SetSpeedRatio(ratio); |
| | | |
| | | if (isChange) |
| | | { |
| | | OnSpeedRatioChange?.Invoke(ratio); |
| | | } |
| | | } |
| | | |
| | | protected virtual void SetBattleStartState() |
| | |
| | | } |
| | | if (recordPlayer == null || battleObjMgr == null) |
| | | return; |
| | | |
| | | recordPlayer.Run(); |
| | | battleObjMgr.Run(); |
| | | battleEffectMgr.Run(); |
| | |
| | | } |
| | | |
| | | operationAgent.Run(); |
| | | |
| | | // 触发 UI 层的更新回调 |
| | | OnBattleRun?.Invoke(); |
| | | } |
| | | |
| | | |