(RealStatePtr L, Type interfaceType, int idx)
| 578 | } |
| 579 | |
| 580 | public object CreateInterfaceBridge(RealStatePtr L, Type interfaceType, int idx) |
| 581 | { |
| 582 | Func<int, LuaEnv, LuaBase> creator; |
| 583 | |
| 584 | if (!interfaceBridgeCreators.TryGetValue(interfaceType, out creator)) |
| 585 | { |
| 586 | #if (UNITY_EDITOR || XLUA_GENERAL) && !NET_STANDARD_2_0 |
| 587 | var bridgeType = ce.EmitInterfaceImpl(interfaceType); |
| 588 | creator = (int reference, LuaEnv luaenv) => |
| 589 | { |
| 590 | return Activator.CreateInstance(bridgeType, new object[] { reference, luaEnv }) as LuaBase; |
| 591 | }; |
| 592 | interfaceBridgeCreators.Add(interfaceType, creator); |
| 593 | #else |
| 594 | throw new InvalidCastException("This type must add to CSharpCallLua: " + interfaceType); |
| 595 | #endif |
| 596 | } |
| 597 | LuaAPI.lua_pushvalue(L, idx); |
| 598 | return creator(LuaAPI.luaL_ref(L), luaEnv); |
| 599 | } |
| 600 | |
| 601 | int common_array_meta = -1; |
| 602 | public void CreateArrayMetatable(RealStatePtr L) |
no test coverage detected