diff --git a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs index 675b3ae3..b9fd0162 100644 --- a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs @@ -420,7 +420,7 @@ namespace Fungus int selectedIndex = 0; blockNames.Add(nullLabel); - Block[] blocks = flowchart.GetComponentsInChildren(true); + Block[] blocks = flowchart.GetComponents(); for (int i = 0; i < blocks.Length; ++i) { blockNames.Add(new GUIContent(blocks[i].blockName)); @@ -458,7 +458,7 @@ namespace Fungus int selectedIndex = 0; blockNames.Add(nullLabel); - Block[] blocks = flowchart.GetComponentsInChildren(); + Block[] blocks = flowchart.GetComponents(); for (int i = 0; i < blocks.Length; ++i) { blockNames.Add(new GUIContent(blocks[i].name)); diff --git a/Assets/Fungus/Flowchart/Editor/FlowchartWindow.cs b/Assets/Fungus/Flowchart/Editor/FlowchartWindow.cs index 3063420d..c19d365e 100755 --- a/Assets/Fungus/Flowchart/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Flowchart/Editor/FlowchartWindow.cs @@ -217,7 +217,7 @@ namespace Fungus protected virtual void DrawFlowchartView(Flowchart flowchart) { - Block[] blocks = flowchart.GetComponentsInChildren(true); + Block[] blocks = flowchart.GetComponents(); foreach (Block block in blocks) { diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs index cbaf75c7..8c5cdea2 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs @@ -36,7 +36,7 @@ namespace Fungus MessageReceived[] receivers = null; if (messageTarget == MessageTarget.SameFlowchart) { - receivers = flowchart.GetComponentsInChildren(); + receivers = flowchart.GetComponents(); } else { diff --git a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs index 246c4eb7..2129741a 100644 --- a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs +++ b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs @@ -169,13 +169,13 @@ namespace Fungus public int NextItemId() { int maxId = -1; - Block[] blocks = GetComponentsInChildren(); + Block[] blocks = GetComponents(); foreach (Block block in blocks) { maxId = Math.Max(maxId, block.itemId); } - Command[] commands = GetComponentsInChildren(); + Command[] commands = GetComponents(); foreach (Command command in commands) { maxId = Math.Max(maxId, command.itemId); @@ -275,7 +275,7 @@ namespace Fungus // Make sure item ids are unique and monotonically increasing. // This should always be the case, but some legacy Flowcharts may have issues. List usedIds = new List(); - Block[] blocks = GetComponentsInChildren(); + Block[] blocks = GetComponents(); foreach (Block block in blocks) { if (block.itemId == -1 || @@ -286,7 +286,7 @@ namespace Fungus usedIds.Add(block.itemId); } - Command[] commands = GetComponentsInChildren(); + Command[] commands = GetComponents(); foreach (Command command in commands) { if (command.itemId == -1 || @@ -304,7 +304,7 @@ namespace Fungus // Unreferenced components don't have any effect on the flowchart behavior, but // they waste memory so should be cleared out periodically. - Block[] blocks = GetComponentsInChildren(); + Block[] blocks = GetComponents(); // Remove any null entries in the variables list // It shouldn't happen but it seemed to occur for a user on the forum @@ -380,7 +380,7 @@ namespace Fungus */ public virtual Block FindBlock(string blockName) { - Block [] blocks = GetComponentsInChildren(); + Block [] blocks = GetComponents(); foreach (Block block in blocks) { if (block.blockName == blockName) @@ -400,7 +400,7 @@ namespace Fungus public virtual bool ExecuteBlock(string blockName) { Block block = null; - foreach (Block b in GetComponentsInChildren()) + foreach (Block b in GetComponents()) { if (b.blockName == blockName) { @@ -455,7 +455,7 @@ namespace Fungus */ public virtual void StopAllBlocks() { - Block [] blocks = GetComponentsInChildren(); + Block [] blocks = GetComponents(); foreach (Block block in blocks) { if (block.IsExecuting()) @@ -471,7 +471,7 @@ namespace Fungus */ public virtual void SendFungusMessage(string messageName) { - MessageReceived[] eventHandlers = GetComponentsInChildren(); + MessageReceived[] eventHandlers = GetComponents(); foreach (MessageReceived eventHandler in eventHandlers) { eventHandler.OnSendFungusMessage(messageName); @@ -554,7 +554,7 @@ namespace Fungus baseKey = "New Block"; } - Block[] blocks = GetComponentsInChildren(); + Block[] blocks = GetComponents(); string key = baseKey; while (true) @@ -837,7 +837,7 @@ namespace Fungus { if (hideComponents) { - Block[] blocks = GetComponentsInChildren(); + Block[] blocks = GetComponents(); foreach (Block block in blocks) { block.hideFlags = HideFlags.HideInInspector; @@ -847,13 +847,13 @@ namespace Fungus } } - Command[] commands = GetComponentsInChildren(); + Command[] commands = GetComponents(); foreach (Command command in commands) { command.hideFlags = HideFlags.HideInInspector; } - EventHandler[] eventHandlers = GetComponentsInChildren(); + EventHandler[] eventHandlers = GetComponents(); foreach (EventHandler eventHandler in eventHandlers) { eventHandler.hideFlags = HideFlags.HideInInspector; @@ -861,7 +861,7 @@ namespace Fungus } else { - MonoBehaviour[] monoBehaviours = GetComponentsInChildren(); + MonoBehaviour[] monoBehaviours = GetComponents(); foreach (MonoBehaviour monoBehaviour in monoBehaviours) { if (monoBehaviour == null) @@ -893,7 +893,7 @@ namespace Fungus { if (resetCommands) { - Command[] commands = GetComponentsInChildren(); + Command[] commands = GetComponents(); foreach (Command command in commands) { command.OnReset(); @@ -932,7 +932,7 @@ namespace Fungus */ public virtual bool HasExecutingBlocks() { - Block[] blocks = GetComponentsInChildren(); + Block[] blocks = GetComponents(); foreach (Block block in blocks) { if (block.IsExecuting()) @@ -950,7 +950,7 @@ namespace Fungus { List executingBlocks = new List(); - Block[] blocks = GetComponentsInChildren(); + Block[] blocks = GetComponents(); foreach (Block block in blocks) { if (block.IsExecuting()) diff --git a/Assets/Fungus/Narrative/Scripts/Localization.cs b/Assets/Fungus/Narrative/Scripts/Localization.cs index c96f2da5..84e2c494 100644 --- a/Assets/Fungus/Narrative/Scripts/Localization.cs +++ b/Assets/Fungus/Narrative/Scripts/Localization.cs @@ -223,7 +223,7 @@ namespace Fungus Flowchart[] flowcharts = GameObject.FindObjectsOfType(); foreach (Flowchart flowchart in flowcharts) { - Block[] blocks = flowchart.GetComponentsInChildren(); + Block[] blocks = flowchart.GetComponents(); foreach (Block block in blocks) { foreach (Command command in block.commandList) diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaEnvironment.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaEnvironment.cs index 30cafe6e..e36240bc 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaEnvironment.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaEnvironment.cs @@ -141,7 +141,7 @@ namespace Fungus InitLuaScriptFiles(); // Initialize any attached initializer components (e.g. LuaUtils) - Initializer[] initializers = GetComponentsInChildren(); + Initializer[] initializers = GetComponents(); foreach (Initializer initializer in initializers) { initializer.Initialize();