using UnityEngine; using UnityEngine.UI; using QFramework; using TMPro; using System.Diagnostics.Eventing.Reader; namespace QFramework.Example { public class UIInstructionData : UIPanelData { } public partial class UIInstruction : UIPanel { protected override void OnInit(IUIData uiData = null) { TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); mData = uiData as UIInstructionData ?? new UIInstructionData(); // please add init code here Training.onValueChanged.AddListener(isOn => { if (isOn) { Training.transform.Find("Label").GetComponent().color = new Color(1, 1, 1, 1f); } else { Training.transform.Find("Label").GetComponent().color = new Color(1, 1, 1, 0.5f); } TrainContent.gameObject.SetActive(isOn); }); Operation.onValueChanged.AddListener(isOn => { if (isOn) { Operation.transform.Find("Label").GetComponent().color = new Color(1, 1, 1, 1f); } else { Operation.transform.Find("Label").GetComponent().color = new Color(1, 1, 1, 0.5f); } OperationContent.gameObject.SetActive(isOn); }); ConfirmBtn.onClick.AddListener(() => Hide()); } protected override void OnOpen(IUIData uiData = null) { if (string.IsNullOrEmpty(Global.Instance.curModule.Descript)) { ContentText.text = "ûÓÐDescriptÏà¹ØÅäÖÃ"; } else { ContentText.text = Global.Instance.curModule.Descript; } } protected override void OnShow() { } protected override void OnHide() { } protected override void OnClose() { } } }