For my game I want to load a variable based on a string. The string is made up of standard text plus the ID of the specific object (so I only need one script that can handle actions for lots of objects). The script looks like this (and doesn’t function):
string reference = "list" + id;
List<int> thisLevels = OtherStaticScript.reference;
It’s pretty obvious to me that it won’t work like this, but still it was worth a try.
So is there a way to make this work or a different approach to this issue?
Thank you in advance for your help!