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));