private static int get_updateWhenOffscreen(IntPtr L) { object obj = null; int result; try { obj = ToLua.ToObject(L, 1); SkinnedMeshRenderer skinnedMeshRenderer = (SkinnedMeshRenderer)obj; bool updateWhenOffscreen = skinnedMeshRenderer.get_updateWhenOffscreen(); LuaDLL.lua_pushboolean(L, updateWhenOffscreen); result = 1; } catch (Exception ex) { result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.get_Message() : "attempt to index updateWhenOffscreen on a nil value"); } return(result); }