新增操作队列是否可以跳步的参数

This commit is contained in:
shenjianxing 2024-12-20 10:31:29 +08:00
parent bf7e2678f7
commit 320cdda697
3 changed files with 22 additions and 6 deletions

View File

@ -103,7 +103,7 @@ namespace QFramework
{ {
OnFinished = null; OnFinished = null;
Deinited = true; Deinited = true;
loader.Recycle2Cache(); loader?.Recycle2Cache();
mPool.Recycle(this); mPool.Recycle(this);
} }
} }

View File

@ -93,9 +93,13 @@ namespace QFramework.Example
btn.onClick.AddListener(() => btn.onClick.AddListener(() =>
{ {
subContent.SetActive(!subContent.activeSelf); subContent.SetActive(!subContent.activeSelf);
if (highIcon.color != highColor) if (op.freeStep)
{ {
TypeEventSystem.Global.Send<StepExecute>(new StepExecute() { index = int.Parse(btn.name) }); if (highIcon.color != highColor)
{
TypeEventSystem.Global.Send<StepExecute>(new StepExecute() { index = int.Parse(btn.name) });
}
} }
}); });
if (item.SubSteps != null) if (item.SubSteps != null)
@ -110,8 +114,11 @@ namespace QFramework.Example
btns.Add(subBtn); btns.Add(subBtn);
subBtn.onClick.AddListener(() => subBtn.onClick.AddListener(() =>
{ {
subBtn.transform.parent.gameObject.SetActive(true); if (op.freeStep)
TypeEventSystem.Global.Send<StepExecute>(new StepExecute() { index = int.Parse(subBtn.name) }); {
subBtn.transform.parent.gameObject.SetActive(true);
TypeEventSystem.Global.Send<StepExecute>(new StepExecute() { index = int.Parse(subBtn.name) });
}
}); });
} }
} }

View File

@ -1,3 +1,4 @@
using QFramework;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Xml.Linq; using System.Xml.Linq;
@ -108,6 +109,7 @@ namespace XMLTool
public class Operation public class Operation
{ {
public string moduleType { get; set; } public string moduleType { get; set; }
public bool freeStep { get; set; }
public List<Step> Steps { get; set; } public List<Step> Steps { get; set; }
} }
public class Step public class Step
@ -140,7 +142,7 @@ namespace XMLTool
// ½âÎöÔ¤¼ÓÔØ¶¯×÷ // ½âÎöÔ¤¼ÓÔØ¶¯×÷
var preLoadElement = appDataElement.Element("PreLoad"); var preLoadElement = appDataElement.Element("PreLoad");
if (preLoadElement!=null) if (preLoadElement != null)
{ {
appData.preLoad = new PreLoad(); appData.preLoad = new PreLoad();
foreach (XElement actionElement in preLoadElement.Elements("Action")) foreach (XElement actionElement in preLoadElement.Elements("Action"))
@ -268,6 +270,13 @@ namespace XMLTool
Steps = new List<Step>(), Steps = new List<Step>(),
}; };
op.moduleType = operationNode.Attribute("moduleType")?.Value; 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")) foreach (XElement stepNode in operationNode.Elements("Step"))
{ {
op.Steps.Add(ParserStep(stepNode, null)); op.Steps.Add(ParserStep(stepNode, null));