UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"pause game when button is clicked"
public class PauseGame : MonoBehaviour { bool isPaused = false; public void PauseTheGame() { if (isPaused) { Time.timeScale = 1; isPaused = false; } else { Time.timeScale = 0; isPaused = true; } } }