cizi.kim Posted August 29, 2011 Share Posted August 29, 2011 I'd like to get return value like a reference parameter of the C++ function. Hi there. I'd like to get values by the reference parameters like c++ function. the sample is in below. - Unigine script void foo( float& ret ) { ret = 1.0f; } - C++ Unigine::Variable var; runWorld( "foo", var ); float ret = var.getFloat(); // ret is 0. PS : Is there any way to get reference values? Link to comment
manguste Posted August 31, 2011 Share Posted August 31, 2011 In C++ API it is not possible to get reference as the return value. But if you can get any variable on C++ side by calling (let's say it's a variable from the world script) pushWorld(), getWorld() and popWorld() after that. Similar functions are available for system and editor scripts. Link to comment
Recommended Posts