| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | |
| | | private Dictionary<int, BattleObject> redCampDict = new Dictionary<int, BattleObject>(); |
| | | private Dictionary<int, BattleObject> blueCampDict = new Dictionary<int, BattleObject>(); |
| | | |
| | | public void Init(int _levelId, TeamBase _redTeam, TeamBase _blueTeam = null) |
| | | public void Init(TeamBase _redTeam, TeamBase _blueTeam) |
| | | { |
| | | if (_levelId == 0 && _blueTeam == null) |
| | | { |
| | | Debug.LogError("BattleObjMgr Init Error: _levelId == 0 && _blueTeam == null 关卡id没有(不是PVE) 也没有蓝色队伍信息(也不是PVP))"); |
| | | return; |
| | | } |
| | | |
| | | if (_levelId != 0 && _blueTeam != null) |
| | | { |
| | | Debug.LogError("BattleObjMgr Init Error: _levelId!= 0 && _blueTeam != null 关卡id有(是PVE) 也有蓝色队伍信息(也不是PVP))"); |
| | | return; |
| | | } |
| | | |
| | | if (_levelId != 0) |
| | | { |
| | | _blueTeam = new TeamBase(); |
| | | _blueTeam.InitByLevelId(_levelId); |
| | | } |
| | | |
| | | CreateTeam(redCampDict, _redTeam); |
| | | CreateTeam(blueCampDict, _blueTeam); |
| | | } |
| | |
| | | item.Value.Run(); |
| | | } |
| | | } |
| | | |
| | | public void ResumeGame() |
| | | { |
| | | foreach (var item in redCampList) |
| | | { |
| | | item.ResumeGame(); |
| | | } |
| | | |
| | | foreach (var item in blueCampList) |
| | | { |
| | | item.ResumeGame(); |
| | | } |
| | | } |
| | | |
| | | public void PauseGame() |
| | | { |
| | | foreach (var item in redCampList) |
| | | { |
| | | item.PauseGame(); |
| | | } |
| | | |
| | | foreach (var item in blueCampList) |
| | | { |
| | | item.PauseGame(); |
| | | } |
| | | } |
| | | } |