Dogan Kirnaz
  • Welcome
  • Setup
    • Quickstart
  • Basics
    • Agent Extensions
    • Audio Extensions
    • Camera Extensions
    • Collision Extensions
    • Coroutine Extensions
    • Encryption Extensions
    • Format Extensions
    • Game Extensions
    • Json Extensions
    • List Extensions
    • Loop Extensions
    • Material Extensions
    • Math Extensions
    • GameObject Extensions
    • Physics Extensions
    • Object Pool Extensions
    • Scene Extensions
    • PlayerPrefs Extensions
  • Support
    • Support
Powered by GitBook
On this page
  1. Basics

Game Extensions

Pause

This method pauses the game by setting Time.timeScale to 0, effectively freezing all time-dependent operations.

GameExtensions.Pause();

Resume

This resumes the game by restoring Time.timeScale to 1, allowing normal gameplay to continue.

GameExtensions.Resume();

Restart

This method restarts the game by geting the current scene using SceneManager. It also resets Time.timeScale to 1.

GameExtensions.Restart();

Speed Up

This speeds up the game by increasing the time scale to 2f, making everything in the game run twice as fast.

GameExtensions.SpeedUp(2f);

Slow Down

This method slows down the game by reducing the time scale to 0.5f, making everything move in slow motion.

GameExtensions.SlowDown(0.5f);

Reset Time

This resets the time scale to its default value of 1, ensuring that the game runs at normal speed.

GameExtensions.ResetTime();
PreviousFormat ExtensionsNextJson Extensions

Last updated 24 days ago