Game Extensions
Pause
This method pauses the game by setting Time.timeScale to 0, effectively freezing all time-dependent operations.
Resume
This resumes the game by restoring Time.timeScale to 1, allowing normal gameplay to continue.
Restart
This method restarts the game by geting the current scene using SceneManager. It also resets Time.timeScale to 1.
Speed Up
This speeds up the game by increasing the time scale to 2f, making everything in the game run twice as fast.
Slow Down
This method slows down the game by reducing the time scale to 0.5f, making everything move in slow motion.
Reset Time
This resets the time scale to its default value of 1, ensuring that the game runs at normal speed.
Last updated