From 47aa1e8269c093e582acf2636a74df84067da733 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 6 Jan 2025 10:49:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A2=98=E7=AD=89=E5=BE=85=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/UITextQuestion.cs | 18 ++++++++++++++---- Assets/Scripts/Xml/XmlParser.cs | 5 +++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/UI/UITextQuestion.cs b/Assets/Scripts/UI/UITextQuestion.cs index d1b44fab..b1e6d874 100644 --- a/Assets/Scripts/UI/UITextQuestion.cs +++ b/Assets/Scripts/UI/UITextQuestion.cs @@ -22,6 +22,7 @@ namespace QFramework.Example public float errorScore = 0; public string scoreName = string.Empty; public string format; + public string finishedEvent; /// /// Ե ÷ Ծ͵÷ Ͳ÷ /// @@ -88,7 +89,7 @@ namespace QFramework.Example } }); } - else if(mData.errorScore != 0) + else if (mData.errorScore != 0) { Check(false, count => { @@ -105,17 +106,26 @@ namespace QFramework.Example if (mData.waitCloseTime != -1) { - ActionKit.Delay(mData.waitCloseTime, () => Hide()).Start(this); + ActionKit.Delay(mData.waitCloseTime, () => HideSelf()).Start(this); return; } - Hide(); - + HideSelf(); }); } } + + public void HideSelf() + { + if (string.IsNullOrEmpty(mData.finishedEvent) == false) + { + StringEventSystem.Global.Send(mData.finishedEvent); + } + Hide(); + } + public void Check(bool isRight, Action callback) { int count = 0; diff --git a/Assets/Scripts/Xml/XmlParser.cs b/Assets/Scripts/Xml/XmlParser.cs index cd411904..47555553 100644 --- a/Assets/Scripts/Xml/XmlParser.cs +++ b/Assets/Scripts/Xml/XmlParser.cs @@ -522,6 +522,11 @@ namespace XMLTool { act.args.Add("format", format.Value); } + XAttribute finishedEvent = action.Attribute("finishedEvent"); + if (finishedEvent != null) + { + act.args.Add("finishedEvent", finishedEvent.Value); + } newAction = act; } break; From fca248f7eb989c250bdcbf24b16ce73813164ac2 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 6 Jan 2025 10:50:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Doc/Xml配置文档.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/Xml配置文档.xml b/Doc/Xml配置文档.xml index 1accb015..37600c9e 100644 --- a/Doc/Xml配置文档.xml +++ b/Doc/Xml配置文档.xml @@ -40,8 +40,9 @@ absolutely="false" true错一个选项就扣全部分 false按错的选项数量来算分 format="{0:F1}" F1代表保留1位小数 F2代表2位 F0代表不保留小数 注意:rightScore与wrongScore不能同时存在 同时存在则只生效rightScore + finishedEvent 用于监听选择题UI消失 --> - +