using UnityEngine; using UnityEngine.UI; using QFramework; using TMPro; using System; using static OperationController; using System.Text.RegularExpressions; namespace QFramework.Example { public class UIResultTipData : UIPanelData { public bool isRight = false; public string label; public float autoHideTime = -1; public Action callback; } public partial class UIResultTip : UIPanel { protected override void OnInit(IUIData uiData = null) { mData = uiData as UIResultTipData ?? new UIResultTipData(); Right.gameObject.SetActive(false); Wrong.gameObject.SetActive(false); TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); } private void OnStepChanged(StepStatusOnChange change) { Hide(); } protected override void OnOpen(IUIData uiData = null) { transform.SetAsLastSibling(); TypeEventSystem.Global.Register(OnStepChanged).UnRegisterWhenDisabled(gameObject); Right.gameObject.SetActive(false); Wrong.gameObject.SetActive(false); mData = uiData as UIResultTipData ?? new UIResultTipData(); GameObject obj; if (mData.isRight) { obj = Right.gameObject; } else { obj = Wrong.gameObject; } obj.SetActive(true); var text = obj.transform.Find("Bg/Label").GetComponent(); text.text = Regex.Unescape(mData.label); if (mData.autoHideTime == -1) { Button btn = obj.GetComponent