/// <summary> /// 移除监听 /// </summary> protected override void RemoveListener() { UIEventListen.Get(ViewSub.btnRaiseBet).onClick -= RaiseBet; UIEventListen.Get(ViewSub.btnLowerBet).onClick -= LowerBet; UIEventListen.Get(ViewSub.btnAddLine).onClick -= AddLine; UIEventListen.Get(ViewSub.btnSubLine).onClick -= SubLine; UIEventListen.Get(ViewSub.btnSpin).onClick -= Spin; }
/// 添加事件监听 /// </summary> /// <param name="go">被监听对象</param> public static UIEventListen Get(Component Comp) { UIEventListen listener = Comp.gameObject.GetComponent <UIEventListen>(); if (listener == null) { listener = Comp.gameObject.AddComponent <UIEventListen>(); } return(listener); }
public DelegateInt onScrollInt; //滚动事件代理; #endregion /// 添加事件监听 /// </summary> /// <param name="go">被监听对象</param> public static UIEventListen Get(GameObject go) { UIEventListen listener = go.GetComponent <UIEventListen>(); if (listener == null) { listener = go.AddComponent <UIEventListen>(); } return(listener); }
static int DebugAction(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UIEventListen obj = (UIEventListen)ToLua.CheckObject <UIEventListen>(L, 1); obj.DebugAction(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// 添加监听,只对view中InitUI()里的UI有效 /// </summary> protected override void AddListener() { UIEventListen.Get(ViewSub.btnRaiseBet).onClick += RaiseBet; UIEventListen.Get(ViewSub.btnLowerBet).onClick += LowerBet; UIEventListen.Get(ViewSub.btnAddLine).onClick += AddLine; UIEventListen.Get(ViewSub.btnSubLine).onClick += SubLine; UIEventListen.Get(ViewSub.btnPayTable).onClick += ShowPayTable; UIEventListen.Get(ViewSub.objPayTable).onClick += ClosePayTable; UIEventListen.Get(ViewSub.btnSpin).onClick += Spin; UIEventListen.Get(ViewSub.btnMaxBet).onClick += SpinMaxBet; changeLineCountListener += UpdateTotalBet; }
static int RemoveClick(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UIEventListen obj = (UIEventListen)ToLua.CheckObject <UIEventListen>(L, 1); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject)); obj.RemoveClick(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int _CreateUIEventListen(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { UIEventListen obj = new UIEventListen(); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UIEventListen.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }