Menu in C#

Hello,

I am new to C# and a bit stuck on making a menu screen (2 buttons, one for the game and one for a how-to-play with images).

Is there a good tutorial on the webs that explains this easily or can someone give me a helping hand?

Thanks in advance

Could take a look at that.

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.

You could use 3D text to create a simple menu.

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 :).