| | |
| | | |
| | | public Action<string, BattleField> onBattleFieldDestroy; |
| | | |
| | | public bool isWaitServerStory = false; //主线等服务端回报 0425 |
| | | |
| | | public override void Init() |
| | | { |
| | | base.Init(); |
| | | |
| | | LogicEngine.Instance.OnUpdate += Run; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerInit; |
| | | |
| | | } |
| | | |
| | | public override void Release() |
| | |
| | | base.Release(); |
| | | LogicEngine.Instance.OnUpdate -= Run; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerInit; |
| | | } |
| | | |
| | | protected void OnPlayerLoginOk() |
| | |
| | | int FuncLineID = (int)exAttr2; |
| | | |
| | | CreateStoryBattle(MapID, FuncLineID, null, null); |
| | | } |
| | | |
| | | void BeforePlayerInit() |
| | | { |
| | | isWaitServerStory = false; //后续考虑断线重连 |
| | | } |
| | | |
| | | // 上游戏的时候 等战斗阵容更新完毕 创建主线副本 敌方的数据可以暂时不显示 己方表现为睡觉 |
| | |
| | | { |
| | | BattleField battleField = null; |
| | | |
| | | bool isCreate = true; |
| | | if (battleFields.TryGetValue(guid, out battleField)) |
| | | { |
| | | BattleDebug.LogError("战场已存在 先进行销毁"); |
| | | battleField.Destroy(); |
| | | //主线战场需一直存在 |
| | | if (string.IsNullOrEmpty(guid)) |
| | | { |
| | | isCreate = false; |
| | | } |
| | | else |
| | | { |
| | | BattleDebug.LogError("战场已存在 先进行销毁"); |
| | | battleField.Destroy(); |
| | | } |
| | | } |
| | | |
| | | battleField = BattleFieldFactory.CreateBattleField(guid, MapID, FuncLineID, extendData, redTeamList, blueTeamList); |
| | | if (isCreate) |
| | | { |
| | | battleField = BattleFieldFactory.CreateBattleField(guid, MapID, FuncLineID, extendData, redTeamList, blueTeamList); |
| | | onBattleFieldCreate?.Invoke(guid, battleField); |
| | | |
| | | onBattleFieldCreate?.Invoke(guid, battleField); |
| | | |
| | | if (string.IsNullOrEmpty(guid)) |
| | | { |
| | | storyBattleField = (StoryBattleField)battleField; |
| | | if (string.IsNullOrEmpty(guid)) |
| | | { |
| | | storyBattleField = (StoryBattleField)battleField; |
| | | } |
| | | battleFields.Add(guid, battleField); |
| | | } |
| | | |
| | | battleFields.Add(guid, battleField); |
| | | |
| | | |
| | | battleField.Init(MapID, FuncLineID, extendData, redTeamList, blueTeamList); |
| | | |
| | |
| | | req.ReqValue = reqValue; |
| | | |
| | | GameNetSystem.Instance.SendInfo(req); |
| | | if (reqType >= 2) |
| | | isWaitServerStory = true; |
| | | } |
| | | |
| | | |