From 320cdda697dd0d81fd69de54743364b278272009 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Fri, 20 Dec 2024 10:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=93=8D=E4=BD=9C=E9=98=9F?= =?UTF-8?q?=E5=88=97=E6=98=AF=E5=90=A6=E5=8F=AF=E4=BB=A5=E8=B7=B3=E6=AD=A5?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/LineAction.cs | 2 +- Assets/Scripts/UI/UIOperationList.cs | 15 +++++++++++---- Assets/Scripts/Xml/XmlParser.cs | 11 ++++++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Actions/LineAction.cs b/Assets/Scripts/Actions/LineAction.cs index b7e28a00..50379fee 100644 --- a/Assets/Scripts/Actions/LineAction.cs +++ b/Assets/Scripts/Actions/LineAction.cs @@ -103,7 +103,7 @@ namespace QFramework { OnFinished = null; Deinited = true; - loader.Recycle2Cache(); + loader?.Recycle2Cache(); mPool.Recycle(this); } } diff --git a/Assets/Scripts/UI/UIOperationList.cs b/Assets/Scripts/UI/UIOperationList.cs index b57a74be..76d40ae5 100644 --- a/Assets/Scripts/UI/UIOperationList.cs +++ b/Assets/Scripts/UI/UIOperationList.cs @@ -93,9 +93,13 @@ namespace QFramework.Example btn.onClick.AddListener(() => { subContent.SetActive(!subContent.activeSelf); - if (highIcon.color != highColor) + if (op.freeStep) { - TypeEventSystem.Global.Send(new StepExecute() { index = int.Parse(btn.name) }); + if (highIcon.color != highColor) + { + + TypeEventSystem.Global.Send(new StepExecute() { index = int.Parse(btn.name) }); + } } }); if (item.SubSteps != null) @@ -110,8 +114,11 @@ namespace QFramework.Example btns.Add(subBtn); subBtn.onClick.AddListener(() => { - subBtn.transform.parent.gameObject.SetActive(true); - TypeEventSystem.Global.Send(new StepExecute() { index = int.Parse(subBtn.name) }); + if (op.freeStep) + { + subBtn.transform.parent.gameObject.SetActive(true); + TypeEventSystem.Global.Send(new StepExecute() { index = int.Parse(subBtn.name) }); + } }); } } diff --git a/Assets/Scripts/Xml/XmlParser.cs b/Assets/Scripts/Xml/XmlParser.cs index b96dd49d..5b9c7428 100644 --- a/Assets/Scripts/Xml/XmlParser.cs +++ b/Assets/Scripts/Xml/XmlParser.cs @@ -1,3 +1,4 @@ +using QFramework; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; @@ -108,6 +109,7 @@ namespace XMLTool public class Operation { public string moduleType { get; set; } + public bool freeStep { get; set; } public List Steps { get; set; } } public class Step @@ -140,7 +142,7 @@ namespace XMLTool // Ԥض var preLoadElement = appDataElement.Element("PreLoad"); - if (preLoadElement!=null) + if (preLoadElement != null) { appData.preLoad = new PreLoad(); foreach (XElement actionElement in preLoadElement.Elements("Action")) @@ -268,6 +270,13 @@ namespace XMLTool Steps = new List(), }; op.moduleType = operationNode.Attribute("moduleType")?.Value; + var free = operationNode.Attribute("freeStep"); + bool isFree = true; + if (free != null) + { + bool.TryParse(free.Value, out isFree); + } + op.freeStep = isFree; foreach (XElement stepNode in operationNode.Elements("Step")) { op.Steps.Add(ParserStep(stepNode, null));