private static void PushPreLoadType(IntPtr L, object o, Type type) { LuaCSFunction preModule = LuaStatic.GetPreModule(L, type); if (preModule != null) { ToLua.LuaPCall(L, preModule); int metaReference = LuaStatic.GetMetaReference(L, type); if (metaReference > 0) { ToLua.PushUserData(L, o, metaReference); return; } } LuaDLL.lua_pushnil(L); Debugger.LogError("Type {0} not wrap to lua", LuaMisc.GetTypeName(type)); }