textmesh array

I simply want to return an array of the component textmesh and output the text in the scene under eachother. Because I have some turrets that i can spawn in the game, and then i have a time counter that shows when they expire and selfdestroy, so they dont stand there forever, making them too overpowered to have.

But the problem is, the timer restarts when i place a new turret down, though they still expire 10 seconds after they’ve been placed, but visually the counter resets. So what i want to achieve is to have an array or something that shows the turret cooldown under eachother. Currently the function looks like this:

public TextMesh sentryCD;

public void SetSentryCD(float cdTime)
	{

		sentryCD.text = "Time left

" + cdTime;
}

and then its called from the turret / sentry script.

void countDown()
	{
		gGui.SetSentryCD(timeLeft);
		timeLeft -= Time.deltaTime;
		if(timeLeft <= 0)
		{
			Destroy(gameObject);
		}

	}

I can’t really wrap my head around this. Do i use a for loop and then something like this

public textmesh[] sentrycdtime;

public void SetSentryCD(float cdTime)
{
for(int i = 0; i < sentrycdtime.Length; i++)
sentryCDtext*.text = "Time left

" + cdTime;*
}
the above code doesnt show anything
so how do i go about it? any help is appreciated

Personally, I would put each turrets timer over/under each of the turrets. That way it’s more clear which turret has how much time left, or even better, make the timer a PART of the turret, like a digital display.

This way, each turret has it’s own script that controls how much time is left, and each turret has its own TextMesh. This will REALLY simplify your problem and your code.