Pause() public method

public Pause ( ) : void
return void
 internal void Pause(int currentPausePointIndex)
 {
     pauseController.Pause();
     this.currentPausePointIndex = currentPausePointIndex;
     buttonAddsPoint             = false;
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(AddRemovePointButtonText)));
 }
    // Update is called once per frame
    void Update()
    {
        // Pause when the player click "Cancel" (by default, Esc)
        if (Input.GetButtonDown("Cancel") && !gameOver)
        {
            paused = !paused;
            pause.Pause();
        }

        //made only to call the gameover
        if (Input.GetKeyDown(KeyCode.Q) && !gameOver)
        {
            GameOver();
        }

        // Where the games go, only can call if isn't paused and isn't gameover
        if (!paused && !gameOver)
        {
            // do everythings here
            if (Input.GetKeyDown(KeyCode.E))
            {
                score.AddScore(0);
            }
        }
    }
Example #3
0
        public IEnumerator PauseOnStart()
        {
            //If we've disabled pause, we need to reenable it so we can pause for stream sync
            if (Plugin.DisablePause)
            {
                //We know pausecontroller will be guaranteed true here since we've already waited for it when disabling pause
                var guaranteedPauseController = pauseController;
                guaranteedPauseController.canPauseEvent -= AntiPause.HandlePauseControllerCanPause_AlwaysFalse;
                guaranteedPauseController.canPauseEvent += standardLevelGameplayManager.HandlePauseControllerCanPause;
            }
            else
            {
                yield return(new WaitUntil(() => standardLevelGameplayManager.GetField <StandardLevelGameplayManager.GameState>("_gameState") == StandardLevelGameplayManager.GameState.Playing));

                yield return(new WaitUntil(() => standardLevelGameplayManager.GetField <PauseController>("_pauseController").GetProperty <bool>("canPause")));
            }

            //Prevent players from unpausing with their menu buttons
            pauseMenuManager.didPressContinueButtonEvent -= pauseController.HandlePauseMenuManagerDidPressContinueButton;

            pauseController.Pause();

            //Wait for the pauseMenuManager to have started and set the pause menu text
            //The text we're checking for is the default text for that field
            yield return(new WaitUntil(() => pauseMenuManager.GetField <TextMeshProUGUI>("_levelNameText").text != @"Super Long Song Name\n<size=80%>ft great artist</size>"));

            pauseMenuManager.GetField <Button>("_restartButton").gameObject.SetActive(false);
            pauseMenuManager.GetField <Button>("_continueButton").gameObject.SetActive(false);
            pauseMenuManager.GetField <Button>("_backButton").gameObject.SetActive(false);
            pauseMenuManager.GetField <TextMeshProUGUI>("_beatmapDifficultyText").gameObject.SetActive(false);
            oldLevelText = pauseMenuManager.GetField <TextMeshProUGUI>("_levelNameText").text;
            pauseMenuManager.GetField <TextMeshProUGUI>("_levelNameText").text = "Please wait!\n<size=80%>Setting up synchronized streams!</size>";
        }
Example #4
0
 public void Tick()
 {
     if (Input.GetKeyDown(_exitCode))
     {
         _pauseController.HandlePauseMenuManagerDidPressMenuButton();
         return;
     }
     if (Input.GetKeyDown(_restartCode))
     {
         _pauseController.HandlePauseMenuManagerDidPressRestartButton();
         return;
     }
     if (Input.GetKeyDown(_pauseToggleCode))
     {
         if (_isPaused)
         {
             _pauseController.HandlePauseMenuManagerDidPressContinueButton();
         }
         else
         {
             _pauseController.Pause();
         }
         return;
     }
 }
 private void Pause()
 {
     Plugin.Log.Debug("Pausing...");
     activePause = false;
     isPaused    = true;
     PauseController.Pause();
 }
 public override void DrawMe()
 {
     if (PauseButton.IsClicked())
     {
         _maestro.PlayOneShot(ButtonSound);
         _controller.Pause();
     }
 }
    private IEnumerator GameOver()
    {
        deathMenu.SetActive(true);
        mainMenu.SetActive(false);
        yield return(new WaitForSeconds(2f));

        PauseController.Pause();
    }
Example #8
0
 private void Pause()
 {
     pauseController.Pause();
     onPausePressed   -= Pause;
     onPausePressed   += Resume;
     onQuitPressed    += Quit;
     onRestartPressed += Restart;
 }
Example #9
0
    private void Update()
    {
        Time.timeScale = timeFactor;

        if (Input.GetKeyDown(KeyCode.Space))
        {
            pauseController.Pause();
        }
    }
Example #10
0
    private void Show()
    {
        e_panel = PANEL.show;
        ShowPanel();

        if (doPauseGame)
        {
            return;
        }
        PauseController.Pause();
    }
Example #11
0
 public void PauseSwitch()
 {
     if (PauseController.is_paused)
     {
         PauseController.Resume();
     }
     else
     {
         PauseController.Pause();
     }
 }
Example #12
0
 public override void Interact()
 {
     if (PlayerCurrentState.CurrentPlayerState != PlayerState.Reading)
     {
         PlayerCurrentState.CurrentPlayerState = PlayerState.Reading;
         Read();
         base.Interact();
     }
     else
     {
         PlayerCurrentState.CurrentPlayerState = PlayerState.None;
         OnCancelRead?.Invoke();
     }
     PauseController.Pause();
 }
Example #13
0
    // Update is called once per frame
    void Update()
    {
        if (createMap.NumberOfGrass == 0 && canLose.IsFinished)
        {
            GameOver();
        }

        // Pause when the player click "Cancel" (by default, Esc)
        if (Input.GetButtonDown("Cancel") && !gameOver)
        {
            paused = !paused;
            pause.Pause();
        }

        // Where the games go, only can call if isn't paused and isn't gameover
        if (!paused && !gameOver)
        {
            horizontalMove = Input.GetAxisRaw("Horizontal");
            verticalMove   = Input.GetAxisRaw("Vertical");
        }
    }
        public IEnumerator PauseOnStart()
        {
            //If we've disabled pause, we need to reenable it so we can pause for stream sync
            if (Plugin.DisablePause)
            {
                //We know pausecontroller will be guaranteed true here since we've already waited for it when disabling pause
                var guaranteedPauseController = pauseController;
                guaranteedPauseController.canPauseEvent -= AntiPause.HandlePauseControllerCanPause_AlwaysFalse;
                guaranteedPauseController.canPauseEvent += standardLevelGameplayManager.HandlePauseControllerCanPause;
            }
            else
            {
                yield return(new WaitUntil(() => standardLevelGameplayManager.GetField <StandardLevelGameplayManager.GameState>("_gameState") == StandardLevelGameplayManager.GameState.Playing));

                yield return(new WaitUntil(() => standardLevelGameplayManager.GetField <PauseController>("_pauseController").GetProperty <bool>("canPause")));
            }

            //Prevent players from unpausing with their menu buttons
            pauseMenuManager.didPressContinueButtonEvent -= pauseController.HandlePauseMenuManagerDidPressContinueButton;

            pauseController.Pause();

            var levelBar = pauseMenuManager.GetField <LevelBar>("_levelBar");

            //Wait for the pauseMenuManager to have started and set the pause menu text
            //The text we're checking for is the default text for that field
            yield return(new WaitUntil(() => levelBar.GetField <TextMeshProUGUI>("_songNameText").text != "!Not Defined!"));

            pauseMenuManager.GetField <Button>("_restartButton").gameObject.SetActive(false);
            pauseMenuManager.GetField <Button>("_continueButton").gameObject.SetActive(false);
            pauseMenuManager.GetField <Button>("_backButton").gameObject.SetActive(false);

            levelBar.hide = false;
            levelBar.GetField <TextMeshProUGUI>("_difficultyText").gameObject.SetActive(false);
            oldLevelText  = levelBar.GetField <TextMeshProUGUI>("_songNameText").text;
            oldAuthorText = levelBar.GetField <TextMeshProUGUI>("_authorNameText").text;
            levelBar.GetField <TextMeshProUGUI>("_songNameText").text   = "请稍等";
            levelBar.GetField <TextMeshProUGUI>("_authorNameText").text = "正在同步直播信号";
        }