Naming a gui?

Hello, I can’t seem to understand how you would be able to edit for example a GUI text with a button. For example if I want to make a textbox and have a button make the text += 1 every time I click it how would I go about doing this? I have read some basic tutorials on GUI’s, however I don’t understand how you get the name to change the text of for example that textbox in c#.

It it hard to understand exactly what you are looking for. Attach this to an empty game object and hit run. Note you should play with the various example scripts for the GUI class in the reference manual. Take a look at the entries for the individual methods, then copy, paste, and play with the scripts.

using UnityEngine;
using System.Collections;

public class Example : MonoBehaviour {

	int score = 0;

	void OnGUI() {
		if (GUI.Button (new Rect(25,25,75,35), "Add Point")) {
			score++;
		}
		GUI.Label (new Rect(50,75,75,35), score.ToString ());
	}
}