I'm creating some scripts and running them in runtime, but I'm compiling them only once(unless the code changes) to avoid "memory leak", since everytime I compile a script it take X Kbs from the memory.
Anyway, I'm trying to find a way to use variables that i can get AND set values to them, because if I so like:
int x = 0;
x += 2;
MessageBox.Show(x.ToString());
It will show me 2 everytime, because it is executing the same code and I want to really set this value to x, but when it executes again it will show me 4,6,8 etc, but for that I need to create that "int x" variable somewhere where I can get it.
I tought about a list of variables and create a method like getvariable(x) and setvariable(x), but this list would need to support all type os variables, int, strings, doubles, etc.
Do you have any idea how I can do that?