I’m trying to figure out how to get this to print a new line for each item in “tempRange” but I’m having a heckuva time figuring this out.
What I’m getting printed is just a single line of text which is the last item of info in “tempRange” which in this case is 19.
I want it to print 20 lines of data, from 0 to 19 inclusive. Is there something I can use such as "
" ?? (I’ve tried
and a dozen other things but none of them seem to work in this case.)
Nothing I’m trying will print more than a single line of data.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TestPrint : MonoBehaviour {
public Text DataStuff;
private string displayInfo;
public void ShowInfo()
{
int tempRange = 20;
for (int i = 0; i < tempRange ; i++)
{
string tempString00 = i.ToString();
string tempString01 = "A 1";
string tempString02 = "A 2";
string tempString03 = "A 3";
string tempString04 = "A 4";
string tempString05 = "A 5";
displayInfo = tempString00 + " " + tempString01 + " " + tempString02 + " " + tempString03 + " " + tempString04 + " " + tempString05 + " " + "
";
DataStuff.text = displayInfo;
}
}
}