So I have a set of lines:
static var restartDrugged_1 = "Was all this just a flashback...";
static var restartDrugged_2 = "It's the drugs";
static var restartDrugged_3 = "Again";
and I have a variable that keeps changing dynamically
var restartDruggedTotal : int;
My idea would be to change the text that is displayed depending on the integer number so I wrote something like this:
var restartDruggedLine : String = "restartDrugged_" + restartDruggedTotal.ToString();
This means that the “restartDruggedLine” will have the name of the variable I want to call (e.g. restartDrugged_2 if restartDruggedTotal = 2).
But now how can I actually call the “restartDrugged_2”?
I have a function that displays text on screen but if I run it with:
ShowText(restartDruggedLine);
I’ll just get “restartDrugged_2”.
Hope the question makes sense!