From cdc5a49106fbf2614cfce187b6cf77da43f367fa Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 8 Jan 2025 15:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/UIHint.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/UI/UIHint.cs b/Assets/Scripts/UI/UIHint.cs index 623d81c3..73deb610 100644 --- a/Assets/Scripts/UI/UIHint.cs +++ b/Assets/Scripts/UI/UIHint.cs @@ -17,6 +17,7 @@ namespace QFramework.Example public partial class UIHint : UIPanel { ResLoader loader; + IAction curAction; protected override void OnInit(IUIData uiData = null) { mData = uiData as UIHintData ?? new UIHintData(); @@ -31,16 +32,22 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { mData = uiData as UIHintData ?? new UIHintData(); + if (curAction != null) + { + curAction.Deinit(); + curAction = null; + } + Icon.gameObject.SetActive(mData.isShowIcon); Label.text = mData.txt; SetItem(1); if (mData.time != -1) { - ActionKit.Delay(mData.time, () => - { - SetItem(0); - - }).Start(this); + curAction = ActionKit.Delay(mData.time, () => + { + SetItem(0); + }); + curAction.Start(this); } if (string.IsNullOrEmpty(mData.audio) == false) {