Ejemplo n.º 1
0
    static public void Main()
    {
        SharpLua l = new SharpLua("main.lua");

        SharpLua.LuaObject load   = l.GetFunction("load");
        SharpLua.LuaObject f      = (SharpLua.LuaObject)l.CallFunction(load, "return ...")[0];
        object[]           result = l.CallFunction(f, "Hello World", l);
        Console.WriteLine((string)result[0]);
        Console.WriteLine(result[1].GetType());
        SharpLua.LuaObject gc = l.GetFunction("collectgarbage");
        l.CallFunction(gc, "collect");
        l.CollectGarbage();

        SharpLua.LuaObject     init = l.GetFunction("init");
        SharpLua.SharpFunction func = FuncCallByLua;
        l.CallFunction(init, func);
        SharpLua.LuaObject callback = l.GetFunction("callback");
        l.CallFunction(callback, 1, null, "string");
    }
Ejemplo n.º 2
0
 public void GC()
 {
     SharpLua.LuaObject gc = L.GetFunction("collectgarbage");
     L.CallFunction(gc, "collect");
     L.CollectGarbage();
 }