| | |
| | | { |
| | | |
| | | |
| | | public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out XLuaTest.Pedding val) |
| | | { |
| | | val = new XLuaTest.Pedding(); |
| | | int top = LuaAPI.lua_gettop(L); |
| | | |
| | | if (Utils.LoadField(L, idx, "c")) |
| | | { |
| | | |
| | | translator.Get(L, top + 1, out val.c); |
| | | |
| | | } |
| | | LuaAPI.lua_pop(L, 1); |
| | | |
| | | } |
| | | |
| | | public static bool Pack(IntPtr buff, int offset, XLuaTest.Pedding field) |
| | | { |
| | | |
| | | if(!Pack(buff, offset, field.c)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | public static bool UnPack(IntPtr buff, int offset, out XLuaTest.Pedding field) |
| | | { |
| | | field = default(XLuaTest.Pedding); |
| | | |
| | | if(!UnPack(buff, offset, out field.c)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out XLuaTest.MyStruct val) |
| | | { |
| | | val = new XLuaTest.MyStruct(); |
| | | int top = LuaAPI.lua_gettop(L); |
| | | |
| | | if (Utils.LoadField(L, idx, "a")) |
| | | { |
| | | |
| | | translator.Get(L, top + 1, out val.a); |
| | | |
| | | } |
| | | LuaAPI.lua_pop(L, 1); |
| | | |
| | | if (Utils.LoadField(L, idx, "b")) |
| | | { |
| | | |
| | | translator.Get(L, top + 1, out val.b); |
| | | |
| | | } |
| | | LuaAPI.lua_pop(L, 1); |
| | | |
| | | if (Utils.LoadField(L, idx, "c")) |
| | | { |
| | | |
| | | translator.Get(L, top + 1, out val.c); |
| | | |
| | | } |
| | | LuaAPI.lua_pop(L, 1); |
| | | |
| | | if (Utils.LoadField(L, idx, "e")) |
| | | { |
| | | |
| | | translator.Get(L, top + 1, out val.e); |
| | | |
| | | } |
| | | LuaAPI.lua_pop(L, 1); |
| | | |
| | | } |
| | | |
| | | public static bool Pack(IntPtr buff, int offset, XLuaTest.MyStruct field) |
| | | { |
| | | |
| | | if(!Pack(buff, offset, field.a)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if(!Pack(buff, offset + 4, field.b)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if(!Pack(buff, offset + 8, field.c)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if(!Pack(buff, offset + 24, field.e)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | public static bool UnPack(IntPtr buff, int offset, out XLuaTest.MyStruct field) |
| | | { |
| | | field = default(XLuaTest.MyStruct); |
| | | |
| | | if(!UnPack(buff, offset, out field.a)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if(!UnPack(buff, offset + 4, out field.b)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if(!UnPack(buff, offset + 8, out field.c)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if(!UnPack(buff, offset + 24, out field.e)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out PushAsTableStruct val) |
| | | { |
| | | val = new PushAsTableStruct(); |
| | | int top = LuaAPI.lua_gettop(L); |
| | | |
| | | if (Utils.LoadField(L, idx, "x")) |
| | | { |
| | | |
| | | translator.Get(L, top + 1, out val.x); |
| | | |
| | | } |
| | | LuaAPI.lua_pop(L, 1); |
| | | |
| | | if (Utils.LoadField(L, idx, "y")) |
| | | { |
| | | |
| | | translator.Get(L, top + 1, out val.y); |
| | | |
| | | } |
| | | LuaAPI.lua_pop(L, 1); |
| | | |
| | | } |
| | | |
| | | public static bool Pack(IntPtr buff, int offset, PushAsTableStruct field) |
| | | { |
| | | |
| | | if(!Pack(buff, offset, field.x)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if(!Pack(buff, offset + 4, field.y)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | public static bool UnPack(IntPtr buff, int offset, out PushAsTableStruct field) |
| | | { |
| | | field = default(PushAsTableStruct); |
| | | |
| | | if(!UnPack(buff, offset, out field.x)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if(!UnPack(buff, offset + 4, out field.y)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Vector2 val) |
| | | { |
| | | val = new UnityEngine.Vector2(); |