Skip to content
Snippets Groups Projects
Select Git revision
  • 0b7180ff33be9868f870418acd67c4443309e570
  • master default
  • JS-based-scroll-rendering
  • Paul_Marius_Level
  • Paul_Marius_2
  • Paul_Marius
  • Andi_Mark
  • be-UnityWebView
  • gitignoreFrameitServer
  • ZimmerBSc
  • Bugfix_StageLoading
  • stages
  • MAZIFAU_Experimental
  • tsc/coneworld
  • tsc/fact-interaction
  • marcel
  • MaZiFAU_TopSort
  • mergeHelper
  • zwischenSpeichern
  • tempAndrToMaster
  • SebBranch
  • 3.0
  • v2.1
  • v2.0
  • v1.0
25 results

TimeStop.cs

Blame
  • TimeStop.cs 558 B
    using UnityEngine;
    
    /*
      https://gamedevbeginner.com/the-right-way-to-pause-the-game-in-unity/#:~:text=The%20most%20convenient%20method%20for%20pausing%20the%20game,will%20return%20the%20game%20to%20its%20normal%20speed.
    */
    
    public class TimeStop: MonoBehaviour
    {
        public bool checkTimeToStop;
    
    
        void Start()
        {
            PauseGame();
        }
    
        private void Update()
        {
            if (checkTimeToStop == true)
                PauseGame();
        }
    
        private void PauseGame()
        {
            UIconfig.GamePaused = true; 
            Time.timeScale = 0;
        }
    }