Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

do Global Pause and Mute variables exist?

Discussion in 'Scripting' started by gizzerd91, Sep 6, 2008.

  1. gizzerd91

    gizzerd91

    Joined:
    May 4, 2008
    Posts:
    311
    One of the big un-addressed peices of feedback about my game has been the need for a pause button. I am willing to do the work to do it all manually, but I thought I'd check here to see if there's a much easier way like GameObject.Pause() or something.

    Another question is can I do a global mute? instead of having to do it manually?
     
  2. gizzerd91

    gizzerd91

    Joined:
    May 4, 2008
    Posts:
    311
    really everybody? nothing?
     
  3. ProtonOne

    ProtonOne

    Joined:
    Mar 8, 2008
    Posts:
    406
    Global Volume control:
    Code (csharp):
    1. AudioListener.volume = 0;
    Global Pause (Depending on your logic):
    Code (csharp):
    1. Time.timeScale = 0;
     
  4. gizzerd91

    gizzerd91

    Joined:
    May 4, 2008
    Posts:
    311
    thanks very much.