Hello,
I have a code for a menu system. I can’t see what’s wrong but it keeps telling me my first if statement is wrong it is expecting a variable not a type. Can anyone help me?
using UnityEngine;
using System.Collections;
public class Menu : MonoBehaviour {
public Texture MainMenuBackground;
public Texture PlayButton;
public Texture QuitButton;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI() {
GUI.DrawTexture(new Rect(0,0,Screen.width,Screen.height),MainMenuBackground,ScaleMode.StretchToFill, false, 0.0f);
if (GUI.Button(Rect(10,500,500,300),PlayButton)) {
Application.LoadLevel("FirstRoom");
}
if (GUI.Button(Rect(50,700,500,300),QuitButton)) {
Application.Quit();
}
}
}