so - i try to set up name of target script, and change target value. (code below)
but i got truble on this line:
comp.ValueName -= 20f;
Because ValueName is variable string…
public string ScriptName = "MainScript";
public string ValueName = "Health" ;
void OnEnable () {
Component comp;
comp = GetComponent (ScriptName);
try {
comp.ValueName -= 20f;
}
catch{
}
}
is it possible?