Beispiel #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);
 }
Beispiel #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);
 }
 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);
         }
     }
 }