Here's how it works
You: I need a Main Menu script with start/exit buttons in C#!
*Wait until I get until my computer and give the code*
Me: Here it is!
using UnityEngine;
using System.Collections;
public class NameofScriptHere : MonoBehaviour {
void OnGUI() {
if (GUI.Button(new Rect(10, 10, 50, 50),"Exit"))
{
Application.Quit();
Debug.Log("Clicked Exit Game");
}
if (GUI.Button(new Rect(10, 70, 50, 30), "Start"))
{
Application.LoadLevel("Name of level 1");
Debug.Log("Clicked Start");
}
}
}
Note: I don't have the Unity editor open infront of me, I've been actually having stability problems with it, so this basic script might not work.