From 8e1423e5082e3d477e38cae8d5d8eb2215eceb33 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Fri, 22 Jan 2016 11:20:56 +0000 Subject: [PATCH] While loop nested inside If doesn't loop correctly #354 --- .../Flowchart/Scripts/Commands/While.cs | 1 + Assets/Tests/Scripting/Scripting.unity | 54 ++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/While.cs b/Assets/Fungus/Flowchart/Scripts/Commands/While.cs index 325f9684..c9e07b18 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/While.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/While.cs @@ -29,6 +29,7 @@ namespace Fungus command.indentLevel == indentLevel) { endCommand = command; + break; } } diff --git a/Assets/Tests/Scripting/Scripting.unity b/Assets/Tests/Scripting/Scripting.unity index 286b8626..f8f344a4 100644 --- a/Assets/Tests/Scripting/Scripting.unity +++ b/Assets/Tests/Scripting/Scripting.unity @@ -1285,7 +1285,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Name: m_EditorClassIdentifier: - selectedFlowchart: {fileID: 1982550314} + selectedFlowchart: {fileID: 491823363} --- !u!4 &646902075 Transform: m_ObjectHideFlags: 1 @@ -1313,7 +1313,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &697320580 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2619,6 +2619,56 @@ MonoBehaviour: viewSize: 1.7469401 primaryAspectRatio: {x: 4, y: 3} secondaryAspectRatio: {x: 2, y: 1} +--- !u!1 &1883088048 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1883088050} + - 114: {fileID: 1883088049} + m_Layer: 0 + m_Name: WhileLoopTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!114 &1883088049 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1883088048} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 10 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 0 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: +--- !u!4 &1883088050 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1883088048} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 491823351} + m_Father: {fileID: 0} + m_RootOrder: 8 --- !u!1 &1920662341 GameObject: m_ObjectHideFlags: 0