2013-01-10 2 views

답변

2

메서드의 서명과 일치하는 대리자를 제공하면이 작업을 수행 할 수 있습니다.

using System; 
using AluminumLua; 

public delegate void HelloDelegate(); 

class Program 
{ 
    public static void Hello() 
    { 
     Console.Write("Hello world!"); 
    } 

    static void Main() 
    { 
     var context = new LuaContext(); 
     var obj = LuaObject.FromDelegate(new HelloDelegate(Hello)); 
     context.SetGlobal("hello", obj); 
     context.Get("hello").AsFunction().Invoke(new LuaObject[] { }); 
    } 
} 
+0

환영합니다 dhantael – Amit