Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Unity Pause Game c#

void PauseGame ()
    {
        Time.timeScale = 0f;
        AudioListener.pause = true;
    }

void ResumeGame ()
    {
        Time.timeScale = 1;
        AudioListener.pause = false;
    }Copy
Source by gamedevbeginner.com #
 
PREVIOUS NEXT
Tagged: #Unity #Pause #Game
ADD COMMENT
Topic
Name
7+8 =