I am going to ask this quick question. Say you had something like this:
GUIContent content = new GUIContent(“Text”);
void OnGUI() {
GUI.Box(new Rect(0, 0, Screen.width, Screen.height), content);
GUI.Button(new Rect(0, 20, 100, 20), "Button")
}
How would you add a new line of text to the content multiple times? (Working consistently)
You should follow smallbits advice and use the new unity ui, but to answer your question:
You could do something like
void OnGUI()
{
GUI.Box(new Rect(0, 0, Screen.width, Screen.height), content);
if (GUI.Button(new Rect(0, 20, 100, 20), "Button"))
{
content.text += "
more Text";
}
}
"
" is the new line character. I can’t check if it works right now but I think it should.