I want to create a zone were my game displays text messages. I googled and managed to make a quick test, but it only displays a line, and I cant find how to modify it to add text lines from any place on the game (the player class, the gameplay class, etc):
public class MsgList : MonoBehaviour {
private Vector2 scrollPosition;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI() {
scrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width (200), GUILayout.Height (50));
GUILayout.Label ("Test message");
GUILayout.EndScrollView ();
}
}
How can I do this?