variable before (dot)

I have a bunch of variables, RT1-36 (standing for RawText)
In a Switch I want to change their Color with RT1.color = Color. Red.
But can I exchange the RT1 with a variable so i can change it dynamicly? (The numbers behind rt)

Why not add all the variable to a array and iterate with a for loop over all the variables? (or use a array for your raw text components from the start)

The language isn’t really designed to do that but you can use a Dictionary as an alternative. If you haven’t seen them before, they basically let you store your variables in one column and use another variable type in the other column to access them.

// A collection with the type on the left indexing the type on the right
Dictionary<int, TextAsset> rawTexts = new Dictionary<int, TextAsset>();

rawTexts.Add(1, RT1);
rawTexts.Add(2, RT2);

rawTexts[1] // This is RT1

Here the int is used as the key, the index, and that’s what you can use to access the value, your variable. You could just as easily have used strings and made “RT1” as an index too. Note that in the example I’m assuming your RT objects are of type TextAsset.