I’ve been trying to create a pause menu for the last couple days. Can some one tell me what I did wrong?
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class PauseMenu : MonoBehaviour {
public Canvas pauseMenu;
public Button resumeButton;
public Button optionsButton;
public Button quitToMainMenuButton;
public Button quitGameButton;
void Start()
{
pauseMenu.enabled = false;
resumeButton.enabled = false;
optionsButton.enabled = false;
quitToMainMenuButton.enabled = false;
quitGameButton.enabled = false;
if (Input.GetKeyDown(KeyCode.P))
{
pauseMenu.enabled = true;
resumeButton.enabled = true;
optionsButton.enabled = true;
quitToMainMenuButton.enabled = true;
quitGameButton.enabled = true;
}
}
public void ResumePress () {
pauseMenu.enabled = false;
resumeButton.enabled = false;
optionsButton.enabled = false;
quitToMainMenuButton.enabled = false;
quitGameButton.enabled = false;
}
public void QuitTMM () {
Application.LoadLevel(0);
}
public void QuitGame () {
Application.Quit();
}
}