#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 SnxxzUIFunctionButtonWrap { public static void __Register(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(Snxxz.UI.FunctionButton); Utils.BeginObjectRegister(type, L, translator, 0, 3, 12, 12); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Invoke", _m_Invoke); Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnPointerClick", _m_OnPointerClick); Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnPointClickLockFunc", _e_OnPointClickLockFunc); Utils.RegisterFunc(L, Utils.GETTER_IDX, "order", _g_get_order); Utils.RegisterFunc(L, Utils.GETTER_IDX, "functionId", _g_get_functionId); Utils.RegisterFunc(L, Utils.GETTER_IDX, "state", _g_get_state); Utils.RegisterFunc(L, Utils.GETTER_IDX, "button", _g_get_button); Utils.RegisterFunc(L, Utils.GETTER_IDX, "icon", _g_get_icon); Utils.RegisterFunc(L, Utils.GETTER_IDX, "title", _g_get_title); Utils.RegisterFunc(L, Utils.GETTER_IDX, "shadow", _g_get_shadow); Utils.RegisterFunc(L, Utils.GETTER_IDX, "locked", _g_get_locked); Utils.RegisterFunc(L, Utils.GETTER_IDX, "clickAudio", _g_get_clickAudio); Utils.RegisterFunc(L, Utils.GETTER_IDX, "useDefaultConfig", _g_get_useDefaultConfig); Utils.RegisterFunc(L, Utils.GETTER_IDX, "alternativeConfig", _g_get_alternativeConfig); Utils.RegisterFunc(L, Utils.GETTER_IDX, "group", _g_get_group); Utils.RegisterFunc(L, Utils.SETTER_IDX, "order", _s_set_order); Utils.RegisterFunc(L, Utils.SETTER_IDX, "functionId", _s_set_functionId); Utils.RegisterFunc(L, Utils.SETTER_IDX, "state", _s_set_state); Utils.RegisterFunc(L, Utils.SETTER_IDX, "button", _s_set_button); Utils.RegisterFunc(L, Utils.SETTER_IDX, "icon", _s_set_icon); Utils.RegisterFunc(L, Utils.SETTER_IDX, "title", _s_set_title); Utils.RegisterFunc(L, Utils.SETTER_IDX, "shadow", _s_set_shadow); Utils.RegisterFunc(L, Utils.SETTER_IDX, "locked", _s_set_locked); Utils.RegisterFunc(L, Utils.SETTER_IDX, "clickAudio", _s_set_clickAudio); Utils.RegisterFunc(L, Utils.SETTER_IDX, "useDefaultConfig", _s_set_useDefaultConfig); Utils.RegisterFunc(L, Utils.SETTER_IDX, "alternativeConfig", _s_set_alternativeConfig); Utils.RegisterFunc(L, Utils.SETTER_IDX, "group", _s_set_group); 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) { Snxxz.UI.FunctionButton gen_ret = new Snxxz.UI.FunctionButton(); 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 Snxxz.UI.FunctionButton constructor!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Invoke(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); { bool __force = LuaAPI.lua_toboolean(L, 2); gen_to_be_invoked.Invoke( __force ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_OnPointerClick(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)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_order(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.order); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_functionId(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.functionId); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_state(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.state); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_button(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.button); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_icon(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.icon); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_title(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.title); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_shadow(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.shadow); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_locked(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.locked); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_clickAudio(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.clickAudio); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_useDefaultConfig(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, gen_to_be_invoked.useDefaultConfig); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_alternativeConfig(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.alternativeConfig); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_group(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.group); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_order(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.order = 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_functionId(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.functionId = 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_state(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); TitleBtnState gen_value;translator.Get(L, 2, out gen_value); gen_to_be_invoked.state = gen_value; } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_button(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.button = (UnityEngine.UI.Button)translator.GetObject(L, 2, typeof(UnityEngine.UI.Button)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_icon(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.icon = (ImageEx)translator.GetObject(L, 2, typeof(ImageEx)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_title(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.title = (TextEx)translator.GetObject(L, 2, typeof(TextEx)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_shadow(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.shadow = (UnityEngine.UI.Shadow)translator.GetObject(L, 2, typeof(UnityEngine.UI.Shadow)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_locked(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.locked = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_clickAudio(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.clickAudio = 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_useDefaultConfig(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.useDefaultConfig = 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_alternativeConfig(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.alternativeConfig = (FunctionButtonConfig)translator.GetObject(L, 2, typeof(FunctionButtonConfig)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_group(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)translator.FastGetCSObj(L, 1); gen_to_be_invoked.group = (Snxxz.UI.FunctionButtonGroup)translator.GetObject(L, 2, typeof(Snxxz.UI.FunctionButtonGroup)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _e_OnPointClickLockFunc(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); int gen_param_count = LuaAPI.lua_gettop(L); Snxxz.UI.FunctionButton gen_to_be_invoked = (Snxxz.UI.FunctionButton)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.OnPointClickLockFunc += gen_delegate; return 0; } if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { gen_to_be_invoked.OnPointClickLockFunc -= 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 Snxxz.UI.FunctionButton.OnPointClickLockFunc!"); return 0; } } }