Hi,
can u tell me how to create esc menu, so that i can choose in it Resume and Quit.
I tried this code but it shows error: Assets/Menu.js(16,5): BCE0005: Unknown identifier: ‘labelOptions’.
var escPressed : boolean;
function Update () {
if(Input.GetKeyDown("esc")){
escPressed = true;
}
}
function OnGUI(){
if(escPressed == true){
labelOptions = GUILayout.Width(90);
GUI.Button(Rect(25,25,100,30),"Quit");
}
}
labelOptions isn’t declared?
Also you missed some code, this should work:
var Pause : boolean = false;
var labelOptions // what it is??
function Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
Pause = !Pause;
}
}
function OnGUI()
{
if (Pause)
{
// labelOptions here?
if (GUI.Button(Rect(25,25,100,30), "Resume"))
{
Pause = false;
}
if (GUI.Button(Rect(60,25,100,30), "Quit"))
{
Application.Quit();
}
}