public static int __index(Lua.lua_State L)
{
if (Lua.lua_gettop(L) == 2 && Luna.get_uniqueid(L, 1) ==
LunaTraits_LWF_Movie.uniqueID)
{
LWF.Movie o =
Luna_LWF_Movie.check(L, 1);
string name = Lua.lua_tostring(L, 2).ToString();
if (o.lwf.GetFieldLua(o, name))
{
return(1);
}
LWF.Movie movie = o.SearchMovieInstance(name, false);
if (movie != null)
{
Lua.lua_pop(L, 1);
Luna_LWF_Movie.push(L, movie, false);
return(1);
}
LWF.Button button = o.SearchButtonInstance(name, false);
if (button != null)
{
Lua.lua_pop(L, 1);
Luna_LWF_Button.push(L, button, false);
return(1);
}
}
{
Lua.lua_CFunction fnc = null;
if (LunaTraits_LWF_Movie.properties.TryGetValue(Lua.lua_tostring(L, 2).ToString(), out fnc))
{
Lua.lua_pop(L, 1); // remove self
return(fnc(L));
}
}
int mt = Lua.lua_getmetatable(L, 1);
if (mt == 0)
{
Lua.luaL_error(L, "__index"); //end
}
Lua.lua_pushstring(L, Lua.lua_tostring(L, 2));
Lua.lua_rawget(L, -2);
return(1);
}