Using iterator value in variable name?

Hi,

I’d like to be able to do a for loop to assign sprites to a number of sprite variables that are named with a sequential marker. Like in the title - sprite1, sprite2, sprite3, etc.

So basically I want to do something like:

for (i = 1; i < 4; i++)
{
   sprite+"i" = newSprite*;*

}
Is that possible? I know one way is to create an identical array of sprite names, but I was curious if there’s a way to reference the variables directly.
Thanks!

In C# you can do something like that by using compile on the fly (like this example), though I’m not sure if it’s something usable in Unity but may be you can try if you set “Api compatibility level” to “.NET” instead of “.NET subset”.