(RealStatePtr L)
| 1121 | } |
| 1122 | |
| 1123 | [MonoPInvokeCallback(typeof(LuaCSFunction))] |
| 1124 | public static int ToFunction(RealStatePtr L) |
| 1125 | { |
| 1126 | try |
| 1127 | { |
| 1128 | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| 1129 | MethodBase m; |
| 1130 | translator.Get(L, 1, out m); |
| 1131 | if (m == null) |
| 1132 | { |
| 1133 | return LuaAPI.luaL_error(L, "ToFunction: #1 argument must be a MethodBase"); |
| 1134 | } |
| 1135 | translator.PushFixCSFunction(L, |
| 1136 | new LuaCSFunction(translator.methodWrapsCache._GenMethodWrap(m.DeclaringType, m.Name, new MethodBase[] { m }).Call)); |
| 1137 | return 1; |
| 1138 | } |
| 1139 | catch (Exception e) |
| 1140 | { |
| 1141 | return LuaAPI.luaL_error(L, "c# exception in ToFunction: " + e); |
| 1142 | } |
| 1143 | } |
| 1144 | |
| 1145 | [MonoPInvokeCallback(typeof(LuaCSFunction))] |
| 1146 | public static int GenericMethodWraper(RealStatePtr L) |
nothing calls this directly
no test coverage detected