#if USE_UNI_LUA using LuaAPI = UniLua.Lua; using RealStatePtr = UniLua.ILuaState; using LuaCSFunction = UniLua.CSharpFunctionDelegate; #else using LuaAPI = XLua.LuaDLL.Lua; using RealStatePtr = System.IntPtr; using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; #endif using XLua; using System.Collections.Generic; namespace XLua.CSObjectWrap { using Utils = XLua.Utils; public class UnityEnginePolygonCollider2DWrap { public static void __Register(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(UnityEngine.PolygonCollider2D); Utils.BeginObjectRegister(type, L, translator, 0, 4, 3, 3); Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetTotalPointCount", _m_GetTotalPointCount); Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetPath", _m_GetPath); Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetPath", _m_SetPath); Utils.RegisterFunc(L, Utils.METHOD_IDX, "CreatePrimitive", _m_CreatePrimitive); Utils.RegisterFunc(L, Utils.GETTER_IDX, "autoTiling", _g_get_autoTiling); Utils.RegisterFunc(L, Utils.GETTER_IDX, "points", _g_get_points); Utils.RegisterFunc(L, Utils.GETTER_IDX, "pathCount", _g_get_pathCount); Utils.RegisterFunc(L, Utils.SETTER_IDX, "autoTiling", _s_set_autoTiling); Utils.RegisterFunc(L, Utils.SETTER_IDX, "points", _s_set_points); Utils.RegisterFunc(L, Utils.SETTER_IDX, "pathCount", _s_set_pathCount); Utils.EndObjectRegister(type, L, translator, null, null, null, null, null); Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0); Utils.EndClassRegister(type, L, translator); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if(LuaAPI.lua_gettop(L) == 1) { var gen_ret = new UnityEngine.PolygonCollider2D(); translator.Push(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.PolygonCollider2D constructor!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_GetTotalPointCount(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); { var gen_ret = gen_to_be_invoked.GetTotalPointCount( ); LuaAPI.xlua_pushinteger(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_GetPath(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { int _index = LuaAPI.xlua_tointeger(L, 2); var gen_ret = gen_to_be_invoked.GetPath( _index ); translator.Push(L, gen_ret); return 1; } if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& translator.Assignable>(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); System.Collections.Generic.List _points = (System.Collections.Generic.List)translator.GetObject(L, 3, typeof(System.Collections.Generic.List)); var gen_ret = gen_to_be_invoked.GetPath( _index, _points ); LuaAPI.xlua_pushinteger(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.PolygonCollider2D.GetPath!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_SetPath(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& translator.Assignable(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Vector2[] _points = (UnityEngine.Vector2[])translator.GetObject(L, 3, typeof(UnityEngine.Vector2[])); gen_to_be_invoked.SetPath( _index, _points ); return 0; } if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& translator.Assignable>(L, 3)) { int _index = LuaAPI.xlua_tointeger(L, 2); System.Collections.Generic.List _points = (System.Collections.Generic.List)translator.GetObject(L, 3, typeof(System.Collections.Generic.List)); gen_to_be_invoked.SetPath( _index, _points ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.PolygonCollider2D.SetPath!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_CreatePrimitive(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { int _sides = LuaAPI.xlua_tointeger(L, 2); gen_to_be_invoked.CreatePrimitive( _sides ); return 0; } if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& translator.Assignable(L, 3)) { int _sides = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Vector2 _scale;translator.Get(L, 3, out _scale); gen_to_be_invoked.CreatePrimitive( _sides, _scale ); return 0; } if(gen_param_count == 4&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& translator.Assignable(L, 3)&& translator.Assignable(L, 4)) { int _sides = LuaAPI.xlua_tointeger(L, 2); UnityEngine.Vector2 _scale;translator.Get(L, 3, out _scale); UnityEngine.Vector2 _offset;translator.Get(L, 4, out _offset); gen_to_be_invoked.CreatePrimitive( _sides, _scale, _offset ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.PolygonCollider2D.CreatePrimitive!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_autoTiling(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, gen_to_be_invoked.autoTiling); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_points(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.points); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_pathCount(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.pathCount); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_autoTiling(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); gen_to_be_invoked.autoTiling = LuaAPI.lua_toboolean(L, 2); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_points(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); gen_to_be_invoked.points = (UnityEngine.Vector2[])translator.GetObject(L, 2, typeof(UnityEngine.Vector2[])); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_pathCount(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.PolygonCollider2D gen_to_be_invoked = (UnityEngine.PolygonCollider2D)translator.FastGetCSObj(L, 1); gen_to_be_invoked.pathCount = LuaAPI.xlua_tointeger(L, 2); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } } }