| | |
| | | |
| | | public TotalDamageDisplayer totalDamageDisplayer; |
| | | |
| | | public SkillTips skillTipsRed; |
| | | |
| | | public SkillTips skillTipsBlue; |
| | | |
| | | private BattleObject bossBattleObject = null; |
| | | |
| | | [SerializeField] public List<BattleBuffCell> buffCells; |
| | |
| | | // SetBattleField(BattleManager.Instance.storyBattleField); |
| | | BattleManager.Instance.onBattleFieldCreate += OnCreateBattleField; |
| | | EventBroadcast.Instance.AddListener<BattleDmgInfo>(EventName.BATTLE_DAMAGE_TAKEN, OnDamageTaken); |
| | | EventBroadcast.Instance.AddListener<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, OnCastSkill); |
| | | |
| | | UIManager.Instance.CloseWindow<MainWin>(); |
| | | } |
| | |
| | | base.OnPreClose(); |
| | | BattleManager.Instance.onBattleFieldCreate -= OnCreateBattleField; |
| | | EventBroadcast.Instance.RemoveListener<BattleDmgInfo>(EventName.BATTLE_DAMAGE_TAKEN, OnDamageTaken); |
| | | EventBroadcast.Instance.RemoveListener<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, OnCastSkill); |
| | | |
| | | UIManager.Instance.CloseWindow<BattleHUDWin>(); |
| | | |
| | |
| | | bossBattleObject.buffMgr.onBuffChanged -= OnBuffChanged; |
| | | bossBattleObject = null; |
| | | } |
| | | |
| | | if (battleField != null) |
| | | { |
| | | battleField.OnRoundChange -= OnRoundChange; |
| | | battleField = null; |
| | | } |
| | | } |
| | | |
| | | private void OnCastSkill(string guid, SkillConfig skillConfig, TeamHero teamHero) |
| | | { |
| | | if (battleField == null) |
| | | return; |
| | | |
| | | if (battleField.guid != guid) |
| | | return; |
| | | |
| | | BattleObject battleObject = battleField.battleObjMgr.GetBattleObject(teamHero.ObjID); |
| | | |
| | | bool isRed = battleObject.Camp == BattleCamp.Red; |
| | | |
| | | SkillTips tips = isRed ? skillTipsRed : skillTipsBlue; |
| | | |
| | | tips.PlayMotion(battleField, isRed, teamHero, skillConfig); |
| | | } |
| | | |
| | | private void OnCreateBattleField(string arg1, BattleField field) |
| | |
| | | Debug.LogError("找不到boss"); |
| | | } |
| | | |
| | | txtBattleRound.text = string.Format("{0}/{1}", battleField.round, battleField.turnMax); |
| | | OnRoundChange(battleField.round, battleField.turnMax); |
| | | |
| | | OnBuffChanged(); |
| | | |
| | | totalDamageDisplayer.SetActive(false); |
| | | |
| | | skillTipsBlue.SetActive(false); |
| | | skillTipsRed.SetActive(false); |
| | | } |
| | | |
| | | private void OnBuffChanged() |
| | |
| | | |
| | | public void SetBattleField(StoryBossBattleField _battleField) |
| | | { |
| | | if (battleField != null) |
| | | { |
| | | battleField.OnRoundChange -= OnRoundChange; |
| | | battleField = null; |
| | | } |
| | | |
| | | battleField = _battleField; |
| | | if (battleRootNode != null) |
| | | { |
| | |
| | | buttonsAdjuster.SetSortingOrder(BattleConst.ActiveHeroActionSortingOrder); |
| | | |
| | | Refresh(); |
| | | |
| | | battleField.OnRoundChange += OnRoundChange; |
| | | |
| | | textSpeed.text = (BattleManager.Instance.speedIndex + 1).ToString(); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OnRoundChange(int round, int maxRound) |
| | | { |
| | | txtBattleRound.text = string.Format("{0}/{1}", round, maxRound); |
| | | } |
| | | } |