JavaでLua関数を作成し、それをLuaに渡して変数に割り当てる方法はありますか?
例えば:
私のJavaクラスでは:
private class doSomething extends ZeroArgFunction { @Override public LuaValue call() { return "function myFunction() print ('Hello from the other side!'); end" //it is just an example } }
私のLuaスクリプトでは:
myVar = myHandler.doSomething(); myVar();
この場合、出力は「Hello from the other side!」になります。