I tried to set a script global from within whatever.rs
:
uint32_t a = 2;
void set_a_from_float(float x) {
// more processing in real life
a = (uint32_t) x;
}
ScriptC_whatever w = new ScriptC_whatever(mRS);
w.invoke_set_a_from_float(3.0f);
Log.d("ContrivedExample:", ""+w.get_a()); // logs 2
This is a silly example and I know I can just use the automatically generated getters/setters, but this error still seems counter-intuitive.
Why wouldn't this work?