static int AddToggleListener(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.GameObject)); System.Action <bool> arg1 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg1 = (System.Action <bool>)ToLua.CheckObject(L, 2, typeof(System.Action <bool>)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg1 = DelegateFactory.CreateDelegate(typeof(System.Action <bool>), func) as System.Action <bool>; } UIUtil.AddToggleListener(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }