It is possible to write one method that can set value to different variables which are loaded by parameter?
I think something about like this:
void SetBooleanValue(bool myVariable, bool newValue)
{
myVariable = newValue;
}
and then use this like that:
bool isConnected = false;
bool isFinished = true;
public ClassConstructor()
{
SetBooleanValue(isConnected, true);
SetBooleanValue(isFinished, false);
}
The problem is my method only gets value of isConnected and isFinished and can't modify original values of those variables.
How to get reference to them?