I'm just learning about Lua and trying to integrate it with C# and mono (on Linux). After some looking around, I found AluminumLua as a wrapper to do so.
I've successfully being able to call from lua to C#, but I can't see the way to call from C# to lua:
lua (test.lua):
HelloWorld()
function print_test()
print("hi")
return 1
end
C#
var context = new LuaContext ();
context.AddBasicLibrary ();
context.AddIoLibrary ();
context.SetGlobal ("HelloWorld", LuaObject.FromDelegate(new Action(HelloWorld)));
var parser = new LuaParser (context, "test.lua");
parser.Parse ();
...
public static void HelloWorld() {
Console.Write("HelloWorld");
}
That's cool, but... How can I call the function "print_test", get its output result from C#?