Ejemplo n.º 1
0
 public void OpenLibraries(LuaState state)
 {
     LuaBindings.luaL_requiref(state, "package", luaopen_package, 1);
     LuaBindingMacros.lua_pop(state, 1);
     LuaBindings.luaL_requiref(state, "io", luaopen_io, 1);
     LuaBindingMacros.lua_pop(state, 1);
     LuaBindings.luaL_requiref(state, "os", luaopen_os, 1);
     LuaBindingMacros.lua_pop(state, 1);
 }
Ejemplo n.º 2
0
 public static void OpenLibraries(LuaState state)
 {
     if (state == IntPtr.Zero)
     {
         throw new Exception("Lua state is null");
     }
     LuaBindings.luaL_requiref(state, "package", luaopen_package, 1);
     LuaBindingMacros.lua_pop(state, 1);
     LuaBindings.luaL_requiref(state, "io", luaopen_io, 1);
     LuaBindingMacros.lua_pop(state, 1);
     LuaBindings.luaL_requiref(state, "os", luaopen_os, 1);
     LuaBindingMacros.lua_pop(state, 1);
 }
Ejemplo n.º 3
0
 public void Update()
 {
     if (DebugEnabled)
     {
         var top = LuaBindings.lua_gettop(State);
         LuaBindings.lua_getglobal(State, "OnExtenderDebugUpdate");
         if (LuaBindingMacros.lua_isfunction(State, -1))
         {
             var result = LuaBindings.lua_pcallk(State, 0, 0, 0, 0, IntPtr.Zero);
         }
         else
         {
             LuaBindings.lua_settop(State, top);
         }
     }
 }