diff --git a/Assets/Scripts/Actions/ActionHelper.cs b/Assets/Scripts/Actions/ActionHelper.cs index 166975b3..14a5fb1a 100644 --- a/Assets/Scripts/Actions/ActionHelper.cs +++ b/Assets/Scripts/Actions/ActionHelper.cs @@ -194,8 +194,8 @@ public class ActionHelper } case "ResultTip": { - var strAction = (XMLTool.StringListAction)act; - return ResultTipAction.Allocate(act.Value, strAction.args[0], strAction.args[1]); + var strAction = (XMLTool.DictionaryAction)act; + return ResultTipAction.Allocate(act.Value, strAction.args); } case "Led": { diff --git a/Assets/Scripts/Actions/ResultTipAction.cs b/Assets/Scripts/Actions/ResultTipAction.cs index 998c7abc..ac21c186 100644 --- a/Assets/Scripts/Actions/ResultTipAction.cs +++ b/Assets/Scripts/Actions/ResultTipAction.cs @@ -1,5 +1,6 @@ using QFramework.Example; using System; +using System.Collections.Generic; using UnityEngine; namespace QFramework @@ -19,15 +20,17 @@ namespace QFramework public string txt; public string isRight; public string finishedEvent; - public static ResultTipAction Allocate(string txt, string isRight, string finishedEvent, System.Action OnFinished = null) + string autoHide; + public static ResultTipAction Allocate(string txt, Dictionary datas, System.Action OnFinished = null) { var retNode = mPool.Allocate(); retNode.ActionID = ActionKit.ID_GENERATOR++; retNode.Deinited = false; retNode.Reset(); retNode.txt = txt; - retNode.isRight = isRight; - retNode.finishedEvent = finishedEvent; + retNode.isRight = datas.ContainsKey("isRight") ? datas["isRight"] : ""; + retNode.finishedEvent = datas.ContainsKey("finishedEvent") ? datas["finishedEvent"] : ""; + retNode.autoHide = datas.ContainsKey("autoHide") ? datas["autoHide"] : "-1"; retNode.OnFinished = OnFinished; return retNode; } @@ -45,6 +48,7 @@ namespace QFramework { data.callback = () => StringEventSystem.Global.Send(finishedEvent); } + float.TryParse(autoHide, out data.autoHideTime); UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => this.Finish()); } diff --git a/Assets/Scripts/Xml/XmlParser.cs b/Assets/Scripts/Xml/XmlParser.cs index 46be7080..ab03bd78 100644 --- a/Assets/Scripts/Xml/XmlParser.cs +++ b/Assets/Scripts/Xml/XmlParser.cs @@ -779,7 +779,7 @@ namespace XMLTool } newAction = act; } - + break; case "LoadRes": { @@ -884,24 +884,21 @@ namespace XMLTool break; case "ResultTip": { - var act = new StringListAction(); + var act = new DictionaryAction(); XAttribute isRight = action.Attribute("isRight"); if (isRight != null) { - act.args.Add(isRight.Value); - } - else - { - act.args.Add("false"); + act.args.Add("isRight", isRight.Value); } XAttribute finishedEvent = action.Attribute("finishedEvent"); if (finishedEvent != null) { - act.args.Add(finishedEvent.Value); + act.args.Add("finishedEvent", finishedEvent.Value); } - else + XAttribute autoHide = action.Attribute("autoHide"); + if (autoHide != null) { - act.args.Add(""); + act.args.Add("autoHide", autoHide.Value); } newAction = act; } diff --git a/Doc/Xml配置文档.xml b/Doc/Xml配置文档.xml index 53edc77f..06b6f190 100644 --- a/Doc/Xml配置文档.xml +++ b/Doc/Xml配置文档.xml @@ -114,7 +114,7 @@ - +