I basically need to use a string passed in through a function as a part of the code.
This is an example of how I'd call the function:
So this way I could find the value of 'ItemID' in 'exampleScript'.
Is this, or something similar, possible?...
Change string into a runnable code (kind of)
This is an example of how I'd call the function:
Code (CSharp):
- findPathVar("GetComponent<exampleScript>()", "ItemID");
Code (CSharp):
- public int findPathVar(string path, string varName) {
- int variableNeeded = gameObject.(path).(varName);
- return variableNeeded;
- }
Is this, or something similar, possible?...
Change string into a runnable code (kind of)