public static void PushDictionary(this IntPtr L, Dictionary <string, double> dict) { Lua.lua_newtable(L); foreach (var pair in dict) { Push(L, pair.Value); Lua.lua_setfield(L, -2, pair.Key); } }
public static void PushDictionary(this IntPtr L, Dictionary <string, string> dict) { Lua.lua_newtable(L); foreach (var pair in dict) { if (pair.Value != null) { Push(L, pair.Value); } else { L.PushNull(); } Lua.lua_setfield(L, -2, pair.Key); } }