Unity How to Create a GUI Label

Add this script to a gameobject in scene or Main Camera for example.

MyGUI.cs
using UnityEngine;
using System.Collections;
 
public class MyGUI: MonoBehaviour {
 
	public string SOME_TEXT = "foo";
 
	void OnGUI() {
		var style = new GUIStyle();
		style.fontSize = 32;
		style.normal.textColor = Color.white;
 
		GUI.Label(new Rect(Screen.width / 2, Screen.height / 2, 200, 50), SCORE_TEXT, style);
	}
}
Navigation
Print/export
Toolbox