#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 ButtonExWrap { public static void __Register(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(ButtonEx); Utils.BeginObjectRegister(type, L, translator, 0, 2, 6, 5); Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnPointerClick", _m_OnPointerClick); Utils.RegisterFunc(L, Utils.METHOD_IDX, "ableTimeChangeEvent", _e_ableTimeChangeEvent); Utils.RegisterFunc(L, Utils.GETTER_IDX, "ableTime", _g_get_ableTime); Utils.RegisterFunc(L, Utils.GETTER_IDX, "interval", _g_get_interval); Utils.RegisterFunc(L, Utils.GETTER_IDX, "customPositiveSound", _g_get_customPositiveSound); Utils.RegisterFunc(L, Utils.GETTER_IDX, "customNegativeSound", _g_get_customNegativeSound); Utils.RegisterFunc(L, Utils.GETTER_IDX, "positiveSound", _g_get_positiveSound); Utils.RegisterFunc(L, Utils.GETTER_IDX, "negativeSound", _g_get_negativeSound); Utils.RegisterFunc(L, Utils.SETTER_IDX, "interval", _s_set_interval); Utils.RegisterFunc(L, Utils.SETTER_IDX, "customPositiveSound", _s_set_customPositiveSound); Utils.RegisterFunc(L, Utils.SETTER_IDX, "customNegativeSound", _s_set_customNegativeSound); Utils.RegisterFunc(L, Utils.SETTER_IDX, "positiveSound", _s_set_positiveSound); Utils.RegisterFunc(L, Utils.SETTER_IDX, "negativeSound", _s_set_negativeSound); 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) { ButtonEx gen_ret = new ButtonEx(); 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 ButtonEx constructor!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_OnPointerClick(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); { UnityEngine.EventSystems.PointerEventData _eventData = (UnityEngine.EventSystems.PointerEventData)translator.GetObject(L, 2, typeof(UnityEngine.EventSystems.PointerEventData)); gen_to_be_invoked.OnPointerClick( _eventData ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_ableTime(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushnumber(L, gen_to_be_invoked.ableTime); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_interval(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushnumber(L, gen_to_be_invoked.interval); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_customPositiveSound(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, gen_to_be_invoked.customPositiveSound); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_customNegativeSound(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, gen_to_be_invoked.customNegativeSound); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_positiveSound(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.positiveSound); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_negativeSound(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.negativeSound); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_interval(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); gen_to_be_invoked.interval = (float)LuaAPI.lua_tonumber(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_customPositiveSound(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); gen_to_be_invoked.customPositiveSound = 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_customNegativeSound(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); gen_to_be_invoked.customNegativeSound = 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_positiveSound(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); gen_to_be_invoked.positiveSound = LuaAPI.xlua_tointeger(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_negativeSound(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); gen_to_be_invoked.negativeSound = LuaAPI.xlua_tointeger(L, 2); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _e_ableTimeChangeEvent(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); int gen_param_count = LuaAPI.lua_gettop(L); ButtonEx gen_to_be_invoked = (ButtonEx)translator.FastGetCSObj(L, 1); System.Action gen_delegate = translator.GetDelegate(L, 3); if (gen_delegate == null) { return LuaAPI.luaL_error(L, "#3 need System.Action!"); } if (gen_param_count == 3) { if (LuaAPI.xlua_is_eq_str(L, 2, "+")) { gen_to_be_invoked.ableTimeChangeEvent += gen_delegate; return 0; } if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { gen_to_be_invoked.ableTimeChangeEvent -= gen_delegate; return 0; } } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } LuaAPI.luaL_error(L, "invalid arguments to ButtonEx.ableTimeChangeEvent!"); return 0; } } }