| | |
| | | TaskManager.Instance.OnTaskUpdate += UpdateTask; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += ShowBlessLV; |
| | | AutoFightModel.Instance.ChangeAutoEvent += DisplayAutoFight; |
| | | AutoFightModel.Instance.AutoAttackEvent += OnAutoAttackEvent; |
| | | AutoFightModel.Instance.OnFightEvent += ChangeMode; |
| | | TeamManager.Instance.OnTeamChange += DisplayCard; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | |
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent; |
| | | ChatManager.Instance.OnUpdateTalkEvent += OnUpdateTalkEvent; |
| | | UIManager.Instance.OnOpenWindow += OnOpenWindow; |
| | | AutoFightModel.Instance.OnAutoChallengeBossEvent += OnAutoChallengeBossEvent; |
| | | TryPlayAutoFightBoss(); |
| | | Display(); |
| | | DisplayFirstChargeBtn(); |
| | |
| | | TaskManager.Instance.OnTaskUpdate -= UpdateTask; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= ShowBlessLV; |
| | | AutoFightModel.Instance.ChangeAutoEvent -= DisplayAutoFight; |
| | | AutoFightModel.Instance.AutoAttackEvent -= OnAutoAttackEvent; |
| | | AutoFightModel.Instance.OnFightEvent -= ChangeMode; |
| | | TeamManager.Instance.OnTeamChange -= DisplayCard; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | |
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent; |
| | | ChatManager.Instance.OnUpdateTalkEvent -= OnUpdateTalkEvent; |
| | | UIManager.Instance.OnOpenWindow -= OnOpenWindow; |
| | | AutoFightModel.Instance.OnAutoChallengeBossEvent += OnAutoChallengeBossEvent; |
| | | |
| | | // 关闭的时候把战斗界面也给关了 虽然是在外面开的 |
| | | UIManager.Instance.CloseWindow<BattleWin>(); |
| | | } |
| | | |
| | | private void OnAutoChallengeBossEvent(bool isStart) |
| | | private void OnAutoAttackEvent() |
| | | { |
| | | if (isStart) |
| | | { |
| | | autoFightBossUIEffectPlayer.Play(); |
| | | } |
| | | else |
| | | { |
| | | autoFightBossUIEffectPlayer.Stop(); |
| | | } |
| | | TryPlayAutoFightBoss(); |
| | | } |
| | | |
| | | private void OnOpenWindow(UIBase win) |
| | |
| | | void TryPlayAutoFightBoss() |
| | | { |
| | | autoFightBossUIEffectPlayer.Stop(); |
| | | if (AutoFightModel.Instance.isAutoAttackSet && AutoFightModel.Instance.isAutoChallengeBoss) |
| | | if (AutoFightModel.Instance.isAutoAttackSet && AutoFightModel.Instance.isAutoAttack && AutoFightModel.Instance.isAutoChallengeBoss) |
| | | { |
| | | autoFightBossUIEffectPlayer.Play(); |
| | | } |