I have it when i press P it pauses the game. I’m trying to make it that it draws a A button which has Resume and Quit buttons inside it. Its not drawing them for some reason. Heres the code:
using UnityEngine;
using System.Collections;
public class Pause : MonoBehaviour {
public bool isPaused = false;
void Update(){
if(Input.GetKeyDown(KeyCode.P) && isPaused == false){
Time.timeScale = 0f;
isPaused = true;
AudioListener.pause = true;
AudioListener.volume = 0;
}
}
void OnGui(){
if(isPaused == true){
GUI.Box(new Rect(30,10,30,10), "Paused");
if(GUI.Button(new Rect(20,10,20,10), "Resume")) {
Application.LoadLevel(1);
}
if(GUI.Button(new Rect(20,10,10,10), "Quit")) {
Application.Quit();
}
}
}
}