I'm using NLUA in a C# project. I use the following code to register a C# method to be availabel in LUA (NLUA) environemnt (and works):
// C# code to register the methoin LUA environment:
Lua state = new Lua();
state["MyLog"] = new LuaLog();
// C# Class and Method:
public class LuaLog {
public void write(string aLog) {
LogManager.addLog(aLog);
}
}
--LUA CODE TO CALL C# METHOD:
MyLog:write("This is a log string")
Well, I want to call "MyLog:write()" but passing a table and not a string. For example:
MyLog:write( {LogText="This is a log string", LogType="INFO"} )
Is it possible? How do I need to write C# method to read that argument as table? I tried:
// C# CODE:
public void write(Dictionary<string, string> aLog)
public void write(List<string> aLog)
But nothing works. Please can you help me?
Thank you!
Practical example:
REGISTER CLASS IN NLUA from C#:
LUA CODE: