You can use the GUIStyle.CalcHeight function for this:
http://docs.unity3d.com/Documentation/ScriptReference/GUIStyle.CalcHeight.html
I'm assuming that the variable 'Answer' is your GUIStyle and 'answer1' is your string. You can figure out the different sizes of the typed in text something like this:
float oneLineHeight = Answer.CalcHeight(new GUIContent(""), 500);
float answerHeight = Answer.CalcHeight(new GUIContent(answer1), 500);
↧