Doesn't it make sense to just pass the value by reference?
public void Register(string desc, ref float val, float minimum,
float maximum, float stepsize) {...}
Of course, using public variables (fields) is also a bad idea ... it will work like this:
ML.Register("Radius", ref lBeacons[i].Radius, 0.0f, 200.0f, 10.0f);
But that will not work if you make a Radiusproperty - so don't do it. Consider transmitting a beacon (or similar) mechanism itself or some other object-oriented (or possibly event-based) mechanism.
sort of:
ML.Register("Radius", lBeacons[i], 0.0f, 200.0f, 10.0f);
from:
private Beacon beacon;
public void Register(string desc, Beacon beacon, float minimum,
float maximum, float stepsize) {
this.beacon = beacon;
}
void Foo() {
beacon.Radius++;
}
Beacon, unsafe . Beacon, .