views:

258

answers:

1

I use the LuaInterface library to run the lua in .net and it works fine. I could access the CLR via lua. But how to call Lua function from C#?

+1  A: 

You'll need to get a reference to a LuaFunction, from which you can use the Call() function.

Sample code can be found on this website.

Charlie Salts
Lua l = new Lua();l.DoFile("log.lua"); LuaFunction f = _LuaTestManager["log_info"] as LuaFunction;if (f != null) f.Call("My log message");Made it. Thanks
Gopalakrishnan Subramani