Exemplo n.º 1
0
    private void EndLevel(Component image, bool doRestart, AudioSource audioSource)
    {
        if (!m_HasAudioPlayed)
        {
            audioSource.Play();
            m_HasAudioPlayed = true;
        }

        m_Timer += Time.deltaTime;
        //image.alpha = m_Timer / fadeDuration;
        ///image.gameObject.SetActive(true);
        //Debug.Log("Exit4");
        if (!(m_Timer > fadeDuration + displayImageDuration))
        {
            return;
        }
        if (doRestart)
        {
            Scene scene = SceneManager.GetActiveScene();
            SceneManager.LoadScene(scene.name);
        }
        else
        {
            //Debug.Log("Exit5");
            //Application.Quit();

            if (P.isPaused)
            {
                P.pauseGame();
            }

            PL.UnLockCursor();
            SceneManager.LoadScene("CreditsScene");
        }
    }
Exemplo n.º 2
0
 public void pauseGame()
 {
     if (isPaused) /// paused -> play
     {
         isPaused       = false;
         Time.timeScale = 1;
         //Debug.Log("IS Playing");
         pausePanel.gameObject.SetActive(false);
         PL.LockCursor();
     }
     else /// play -> pause
     {
         isPaused       = true;
         Time.timeScale = 0;
         //Debug.Log("IS PAUSED");
         pausePanel.gameObject.SetActive(true);
         PL.UnLockCursor();
     }
 }
Exemplo n.º 3
0
 public void QuitGame()
 {
     P.pauseGame();
     PL.UnLockCursor();
     SceneManager.LoadScene("MenuScene");
 }