using UnityEngine; using UnityEngine.UI; using QFramework; using System; using System.Collections.Generic; using TMPro; using static OperationController; namespace QFramework.Example { public class UITipWindowData : UIPanelData { public class ItemData { public string txt; public Action OnClick; } public string txt; public List btns = new List(); } public partial class UITipWindow : UIPanel { protected override void OnInit(IUIData uiData = null) { mData = uiData as UITipWindowData ?? new UITipWindowData(); // please add init code here TypeEventSystem.Global.Register(OnStepChanged); } private void OnStepChanged(StepStatusOnChange change) { Hide(); } protected override void OnOpen(IUIData uiData = null) { mData = uiData as UITipWindowData ?? new UITipWindowData(); Label.text = mData.txt; BtnContent.RemoveAllChildren(); if (mData != null) { foreach (var item in mData.btns) { GameObject obj = GameObject.Instantiate(BtnPrefab.gameObject, BtnContent); obj.transform.Find("Label").GetComponent().text = item.txt; obj.GetComponent