Closed Symbai closed 5 years ago
Yes, it is possible:
public static void PrintByte(string message)
=> Console.WriteLine("PrintByte1: {0}", message);
public static void PrintByte(byte value, string message)
=> Console.WriteLine("PrintByte2: {0}: {1}", message, value);
static void Main(string[] args)
{
var l = new Lua();
var g = new LuaGlobal(l);
dynamic dg = g;
dg.printByte = new LuaOverloadedMethod(null,
new MethodInfo[] {
new Action<string>(PrintByte).Method,
new Action<byte,string>(PrintByte).Method
});
g.DoChunk("printByte('Hi'); printByte(0x1, 'Hi');", "test.lua");
}
Thank you
Is there a way to declare two functions with same name but different arguments? Like: