Skip to content

Instantly share code, notes, and snippets.

@andrejeller
Last active November 25, 2020 23:06
Show Gist options
  • Save andrejeller/e0918821c81172cde360bd529d6f526a to your computer and use it in GitHub Desktop.
Save andrejeller/e0918821c81172cde360bd529d6f526a to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PauseMenu : MonoBehaviour {
void Start() {
}
void Update() {
if (Input.GetKeyDown(KeyCode.P)) {
PausarJogo();
}
}
void PausarJogo() {
if (Time.timeScale == 0) {
Time.timeScale = 1;
} else if (Time.timeScale == 1) {
Time.timeScale = 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment