Added the pausing and playing of music when the game is paused or not
This commit is contained in:
@@ -1312,6 +1312,7 @@ MonoBehaviour:
|
||||
CongratsText: {fileID: 0}
|
||||
pauseFirstButton: {fileID: 223326611}
|
||||
gameOverFirstButton: {fileID: 0}
|
||||
music: {fileID: 1467720640}
|
||||
--- !u!114 &989087329
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -7540,6 +7540,7 @@ MonoBehaviour:
|
||||
CongratsText: {fileID: 1992981387}
|
||||
pauseFirstButton: {fileID: 312387577}
|
||||
gameOverFirstButton: {fileID: 630916946}
|
||||
music: {fileID: 2074891275}
|
||||
--- !u!1 &1728628295
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -1557,6 +1557,7 @@ MonoBehaviour:
|
||||
CongratsText: {fileID: 0}
|
||||
pauseFirstButton: {fileID: 783395647}
|
||||
gameOverFirstButton: {fileID: 0}
|
||||
music: {fileID: 1128321816}
|
||||
--- !u!114 &1111617282
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -1090,6 +1090,7 @@ MonoBehaviour:
|
||||
CongratsText: {fileID: 0}
|
||||
pauseFirstButton: {fileID: 1040909057}
|
||||
gameOverFirstButton: {fileID: 0}
|
||||
music: {fileID: 595592872}
|
||||
--- !u!114 &963355971
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -25,6 +25,8 @@ public class PauseMenu : MonoBehaviour
|
||||
public GameObject pauseFirstButton;
|
||||
public GameObject gameOverFirstButton;
|
||||
|
||||
public AudioSource music;
|
||||
|
||||
private bool highscore = false;
|
||||
private int gameOver = 0;
|
||||
|
||||
@@ -90,6 +92,7 @@ public class PauseMenu : MonoBehaviour
|
||||
Time.timeScale = 1f;
|
||||
GameIsPaused = false;
|
||||
GameIsOver = false;
|
||||
music.Play();
|
||||
}
|
||||
|
||||
void Pause()
|
||||
@@ -101,6 +104,7 @@ public class PauseMenu : MonoBehaviour
|
||||
GameIsPaused = true;
|
||||
EventSystem.current.SetSelectedGameObject(null);
|
||||
EventSystem.current.SetSelectedGameObject(pauseFirstButton);
|
||||
music.Pause();
|
||||
}
|
||||
|
||||
void GameOver()
|
||||
@@ -111,6 +115,7 @@ public class PauseMenu : MonoBehaviour
|
||||
gameOverUI.SetActive(true);
|
||||
Time.timeScale = 0f;
|
||||
GameIsPaused = true;
|
||||
music.Pause();
|
||||
|
||||
if(FloorLevel.gameOver == true)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user