Can I use strings with static variables?

Hi there! I've been wondering, if I can make as script that lets me define a variable as in inspector, that is then fetched from other script.

I hope this example of nonfunctionin imaginary code shows what I am after:

var TargetVar = "pcount"; //This string here tells which Var to get.
if(StoredStaticVariablesScript.TargetVar<1){ //This here gets it, although I can see that it will never work like this
print("No More!");
}

I hope you got what I am looking for

Any ideas?

This may be possible if you made a custom editor for your first script, you'll need some kind of reference to the second script inside the first.

You could use eval() for that, although there's a performance hit the first time it's used with a piece of code, since it has to be compiled on the fly.