I am working on a inspector tool. I am wondering how can I pick/affect a variable in a object using a string (written variable name).
Example:
public class Data {
public int score;
}
public class Check {
public Data data;
public void Something() {
Affect( data, "score", 10 );
}
public void Affect( Object obj, string variableName, ... ){
//No idea what I should do
}
}
I am not exactly sure what I should search in Google at all. It will be greatly if someone can point me to the right direction/articles/webpage.