// Update is called once per frame void Awake() { _GoCanvasRoot = GameObject.FindGameObjectWithTag(SysDefine.SYS_TAG_CANVAS); _TraUIScriptsNode = UnityHelper.FindTheChildNode(_GoCanvasRoot, SysDefine.SYS_Node_ScriptMgr); UnityHelper.AddChildNodeToParentNode(_TraUIScriptsNode, this.gameObject.transform); }
/// <summary> /// 注册按钮事件 /// </summary> protected void RigisterBtnOnClick(string btnName, EventTriggerListener.VoidDelegate del) { Transform btn = UnityHelper.Find(gameObject.transform, btnName); 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; }