/// <summary> /// 触发事件 /// </summary> /// <param name="listener"></param> /// <param name="args"></param> public void TriggerHandle(EventTriggerListener listener, object args) { if (null != eventHandle) { eventHandle(listener, args, handleParams); } }
void ButtonEvent(EventTriggerListener listener, object args, params object[] objParams) { Debug.Log("ButtonEvent"); UIManager.Instance.OpenUICloseOthers(EnumUIType.TestOne); }
protected void RegisterBtnOnClick(Transform btn, EventTriggerListener.VoidDelegate del) { EventTriggerListener.Get(btn?.gameObject).onClick = del; }
/// <summary> /// 注册滑动条 /// </summary> /// <param name="sliderName"></param> /// <param name="del"></param> protected void RegisterSlider(string sliderName, EventTriggerListener.VoidDelegate del) { Transform slider = UnityHelper.Find(gameObject.transform, sliderName); EventTriggerListener.Get(slider?.gameObject).onUp = del; }
/// <summary> /// 注册按钮事件 /// </summary> /// <param name="btnName"></param> /// <param name="del"></param> protected void RegisterBtnOnClick(string btnName, EventTriggerListener.VoidDelegate del) { Transform btn = UnityHelper.Find(gameObject.transform, btnName); EventTriggerListener.Get(btn?.gameObject).onClick = del; }