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