| | |
| | | |
| | | private BattleField battleField; |
| | | |
| | | float lastClickTime; |
| | | float lastClickTime; //点击BOSS挑战 |
| | | bool needGuide = false; |
| | | |
| | | float lastAnyClickTime; // 任何点击 |
| | | |
| | | // 生命周期 |
| | | protected override void InitComponent() |
| | | { |
| | |
| | | protected override void OnPreOpen() |
| | | { |
| | | lastClickTime = Time.realtimeSinceStartup; |
| | | lastAnyClickTime = Time.realtimeSinceStartup; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefresh; |
| | | needGuide = !MainLevelManager.Instance.IsPassedByMainLevelID(BattleManager.Instance.fightGuideMainLevelLimit); |
| | |
| | | if (!needGuide) |
| | | return; |
| | | |
| | | // if (Input.GetMouseButtonDown(0)) |
| | | // { |
| | | // lastClickTime = Time.realtimeSinceStartup; |
| | | // } |
| | | |
| | | UpdateAnyClickTime(); |
| | | |
| | | if (Time.realtimeSinceStartup - lastClickTime > BattleManager.Instance.fightGuideNoClickSeconds) |
| | | { |
| | | // if (AutoFightModel.Instance.isAutoAttack) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | if (NewBieCenter.Instance.inGuiding) |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | NewBieCenter.Instance.StartNewBieGuide(BattleManager.Instance.fightGuideID); |
| | | NewBieCenter.Instance.StartNewBieGuide(BattleManager.Instance.fightBossGuideID); |
| | | needGuide = !MainLevelManager.Instance.IsPassedByMainLevelID(BattleManager.Instance.fightGuideMainLevelLimit); |
| | | BattleManager.Instance.storyBattleField.IsPause = false; |
| | | lastClickTime = Time.realtimeSinceStartup; |
| | | } |
| | | } |
| | | |
| | | void UpdateAnyClickTime() |
| | | { |
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.AutoFight)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (Time.realtimeSinceStartup - lastAnyClickTime > 3) |
| | | { |
| | | lastAnyClickTime = Time.realtimeSinceStartup; |
| | | if (NewBieCenter.Instance.currentGuide != 0) |
| | | { |
| | | // 新手引导中不允许点击 |
| | | return; |
| | | } |
| | | |
| | | if (UIManager.Instance.ExistAnyFullScreenOrMaskWin("")) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (TaskManager.Instance.GetMainTaskState() == 2) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (BattleManager.Instance.storyBattleField != null && |
| | | BattleManager.Instance.storyBattleField.recordPlayer.IsPlaying()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | NewBieCenter.Instance.StartNewBieGuide(BattleManager.Instance.fightBGuideID); |
| | | BattleManager.Instance.storyBattleField.IsPause = false; |
| | | lastAnyClickTime = Time.realtimeSinceStartup; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |