static int LoadObjects_Lua(IntPtr L) { var objs = ResMgr.LoadAll(Api.lua_tostring(L, 1)); Api.lua_createtable(L, objs.Length, 0); for (int i = 0; i < objs.Length; ++i) { lua.Lua.PushObjectInternal(L, objs[i]); Api.lua_seti(L, -2, i); } return(1); }
static int LoadSprites_Lua(IntPtr L) { var sprites = ResMgr.LoadAll <Sprite>(Api.lua_tostring(L, 1)); if (sprites == null) { return(0); } Api.lua_createtable(L, sprites.Length, 0); for (int i = 0; i < sprites.Length; ++i) { lua.Lua.PushObjectInternal(L, sprites[i]); Api.lua_seti(L, -2, i + 1); } return(1); }
static int LoadAll_Lua(IntPtr L) { var objs = ResMgr.LoadAll(Api.lua_tostring(L, 1), (System.Type)lua.Lua.ObjectAtInternal(L, 2)); if (objs == null) { return(0); } Api.lua_createtable(L, objs.Length, 0); for (int i = 0; i < objs.Length; ++i) { lua.Lua.PushObjectInternal(L, objs[i]); Api.lua_seti(L, -2, i); } return(1); }