private Button Btn_Count; //增加数字 /// <summary> /// 必须定义一个构造函数,继承带有NAME参数的父类构造函数 /// </summary> /// <param name="goRootNode">界面UI的根节点</param> public DataMediator(GameObject goRootNode) : base(NAME) { //找到控件 Txt_Num = UnityHelper.FindChildNode(goRootNode, nameof(Txt_Num)).gameObject.GetComponent <Text>(); Btn_Count = UnityHelper.FindChildNode(goRootNode, nameof(Btn_Count)).gameObject.GetComponent <Button>(); //注册按钮 Btn_Count.onClick.AddListener(OnClick_AddNum); }
private void Awake() { base.CurrentUIType.UIForms_ShowMode = UIFormShowMode.ReverseChange; base.CurrentUIType.UIForms_Type = UIFormType.PopUp; base.CurrentUIType.UIForm_LucencyType = UIFormLucenyType.Translucence; RegisterButtonEvent("btn_back", p => CloseUIForm("ItemsInfoUIForm")); infoText = UnityHelper.FindChildNode(this.gameObject, "InfoText").GetComponent <Text>(); MessageCenter.Register("ItemsInfo", p => { infoText.text = p.Values.ToString(); }); }
private void StopScriptRunning() { //小鸟脚本的停止运行 GameObject.FindGameObjectWithTag("Player").GetComponent <Ctrl_BirdControl>().StopGame(); //管道组脚本的停止运行 UnityHelper.FindChildNode(goRoot, ProConsts.NAME_Pipes).GetComponent <Ctrl_PipeMoving>().StopGame(); //地面脚本的停止运行 //UnityHelper.FindChildNode(goRoot, ProConsts.NAME_Lands).GetComponent<Ctrl_LandMoving>().StopGame(); //获取时间脚本的停止运行 goRoot.GetComponent <Ctrl_GetTime>().StopGame(); //管道碰撞检测脚本的停止执行(不需要) //触发检测脚本的停止执行(不需要) }
void Awake() { _GoCanvasRoot = GameObject.FindGameObjectWithTag(SysDefine.SYS_TAG_CANVAS); _TraUIScriptsNode = _GoCanvasRoot.transform.Find("_ScriptMgr"); UnityHelper.AddChildNodeToParentNode(_TraUIScriptsNode, this.transform); _GoTopPanel = _GoCanvasRoot; _GoMaskPanel = UnityHelper.FindChildNode(_GoCanvasRoot, "UIMaskPanel").gameObject; _UICamera = GameObject.FindGameObjectWithTag(SysDefine.SYS_TAG_CAMERA).GetComponent <Camera>(); if (_UICamera != null) { _OriginalUICameraDepth = _UICamera.depth; } }