The script that i use for all the buttons in the menu
#pragma strict
var pauseKey : KeyCode;
var PauseActive : GameObject;
function Update () {
if (Input.GetKeyUp(pauseKey) && PauseActive.GetComponent(Canvas).enabled == false){
Pause();
}else if (Input.GetKeyUp(pauseKey) && PauseActive.GetComponent(Canvas).enabled == true){
UnPause();
}
}
function Pause () {
PauseActive.GetComponent(Canvas).enabled = true;
Debug.Log("Paused");
Time.timeScale = 0f;
}
function UnPause () {
PauseActive.GetComponent(Canvas).enabled = false;
Debug.Log("Un-paused");
Time.timeScale = 1f;
}
function SaveGame () {
PlayerPrefs.SetInt("LevelNumber", Application.loadedLevel);
Debug.Log("Game has been saved!");
}
on the first level if i press the pauseKey the ui shows up and all the buttons are selectable, if i do it on the second level or any other level it shows the ui but the buttons arent selectable i have it setup in the exact same way on ever scene. if anyone has any ideas how to fix this please let me know as its been frustrating me for 3 days now!