Basically, you need to declare a function OnGUI inside a script attached to a gameObject. Inside that function, you need to use GUI functions to draw stuff. In your case GUI.Button and probably GUI.Label. Keep in mind that OnGUI is called several times per frame, by Unity, so you mustn’t calcul anything heavy in there.
using UnityEngine;
using System.Collections;
public class MenuObject : MonoBehaviour
{
public bool isQuit = false;
void OnMouseEnter()
{
renderer.material.color = Color.blue;
}
void OnMouseExit()
{
renderer.material.color = Color.white;
}
void OnMouseDown()
{
if(isQuit)
{
Application.Quit();
}
else
{
Application.LoadLevel(1); //Make sure that level "1" is located in your build settings. You can also change the 1 with a name of your scene.
}
}
}
Make 2x a 3D text, One named Start game and the other Quit game. Make sure you highlight the public bool “is Quit” and it’s working :).