How to display elements of an array, using a 3D text Box?

Hi everyone, I am new to Unity.

I am trying to display elements of a simple array to a 3D text box. However, whenever I click on the play button in Unity, it only displays the last element in the array in the 3D text box, instead of all three elements.

I had hoped to accomplish the above to better understand what I am doing, in order to accomplish the following;

I am also trying to display each element in the array one at a time, instead of showing them all at once. To be more specific, the first element should display and then be replaced by the next element in the array, and so on until it reaches the end of the array.

I have tried to implement a Timer function, but I am not even sure if that makes any sense at all. I thought if I displayed the first element, and then cleared the text box, to show the next element, it would accomplish my goal, but it doesn’t. I am stumped at this point

I would appreciate your time and help with this, thank you.

Please see my code below;

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

public class ShowData : MonoBehaviour {

int[] numbers = new int[3] { 140, 145, 150 };

float elapsedTime = 0;

void Start () {

}

void Update () {

    DisplayInfo();

}

void DisplayInfo()
{
    string[] result = numbers.Select(x => x.ToString()).ToArray();

    for (int i = 0; i < result.Length; i++)
    {

        GetComponent<TextMesh>().text = result*;*

Timer();

}
}
void Timer()
{
elapsedTime += Time.deltaTime;
if (elapsedTime >= 3)
{
GetComponent().text = “”;
elapsedTime = 0;
}
}
}

hi;
there are many way to achive this ;
u can use update or Corutines or any thing but ill give u an example using Invoke Repeat;

 int[] numbers = new int[3] { 140, 145, 150 };
    int TextNumberToShow;
    void Start()
    {
        InvokeRepeating("showTextInArray", 0, 3);
    }

    void showTextInArray()
    {
        GetComponent<TextMesh>().text = numbers[TextNumberToShow].ToString();

        TextNumberToShow++;
        if (TextNumberToShow  ==numbers.Length)
            TextNumberToShow = 0;

    }

so with “InvokeRepeating” u call the “showTextInArray” each 3 seconds ;
then u have an int variable that stores the Element of the array that should be shown ;
i write the code fast maybe it has some synatic problem;
ask question in my gmail :
savajjad@gmail.com