diff --git a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs index 9691232b..c223a8f4 100644 --- a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs +++ b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs @@ -880,6 +880,41 @@ namespace Fungus return true; } + /** + * Returns true if there are any executing blocks in this Flowchart. + */ + public virtual bool HasExecutingBlocks() + { + Block[] blocks = GetComponentsInChildren(); + foreach (Block block in blocks) + { + if (block.IsExecuting()) + { + return true; + } + } + return false; + } + + /** + * Returns a list of all executing blocks in this Flowchart. + */ + public virtual List GetExecutingBlocks() + { + List executingBlocks = new List(); + + Block[] blocks = GetComponentsInChildren(); + foreach (Block block in blocks) + { + if (block.IsExecuting()) + { + executingBlocks.Add(block); + } + } + + return executingBlocks; + } + public virtual string SubstituteVariables(string text) { string subbedText = text;