diff --git a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs index f251167e..505c03e0 100644 --- a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs @@ -125,7 +125,7 @@ namespace Fungus ReorderableListControl.DrawControlFromState(adaptor, null, flags); } - // EventType.contextClick doesn't register since we moved the Sequence Editor to be inside + // EventType.contextClick doesn't register since we moved the Block Editor to be inside // a GUI Area, no idea why. As a workaround we just check for right click instead. if (Event.current.type == EventType.mouseUp && Event.current.button == 1) diff --git a/Assets/Tests/Commands.meta b/Assets/Tests/Commands.meta new file mode 100644 index 00000000..56e7eb8b --- /dev/null +++ b/Assets/Tests/Commands.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 142c97e360717444dbacc1b2e07b001d +folderAsset: yes +timeCreated: 1441382833 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Commands/FailTest.cs b/Assets/Tests/Commands/FailTest.cs new file mode 100644 index 00000000..e5f286e9 --- /dev/null +++ b/Assets/Tests/Commands/FailTest.cs @@ -0,0 +1,22 @@ +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + + [CommandInfo("Tests", + "Fail", + "Fails the current integration test")] + public class FailTest : Command + { + public string failMessage; + + public override void OnEnter() + { + IntegrationTest.Fail(failMessage); + + Continue(); + } + } + +} \ No newline at end of file diff --git a/Assets/Tests/Commands/FailTest.cs.meta b/Assets/Tests/Commands/FailTest.cs.meta new file mode 100644 index 00000000..0e2d36ab --- /dev/null +++ b/Assets/Tests/Commands/FailTest.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2dcb71131f45b47fead560a97ef55f1c +timeCreated: 1441382828 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Commands/PassTest.cs b/Assets/Tests/Commands/PassTest.cs new file mode 100644 index 00000000..733c09c7 --- /dev/null +++ b/Assets/Tests/Commands/PassTest.cs @@ -0,0 +1,20 @@ +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + + [CommandInfo("Tests", + "Pass", + "Passes the current integration test")] + public class PassTest : Command + { + public override void OnEnter() + { + IntegrationTest.Pass(); + + Continue(); + } + } + +} \ No newline at end of file diff --git a/Assets/Tests/Commands/PassTest.cs.meta b/Assets/Tests/Commands/PassTest.cs.meta new file mode 100644 index 00000000..e87ecf67 --- /dev/null +++ b/Assets/Tests/Commands/PassTest.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4920f47cde1a84b11ad07b7317568494 +timeCreated: 1441383087 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Scripting/Scripting.unity b/Assets/Tests/Scripting/Scripting.unity index 64535a84..974bf493 100644 --- a/Assets/Tests/Scripting/Scripting.unity +++ b/Assets/Tests/Scripting/Scripting.unity @@ -126,7 +126,317 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 +--- !u!1 &396492925 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 396492935} + - 114: {fileID: 396492926} + - 114: {fileID: 396492930} + - 114: {fileID: 396492933} + - 114: {fileID: 396492928} + - 114: {fileID: 396492932} + - 114: {fileID: 396492929} + - 114: {fileID: 396492931} + - 114: {fileID: 396492927} + - 114: {fileID: 396492936} + - 114: {fileID: 396492934} + - 114: {fileID: 396492939} + - 114: {fileID: 396492938} + - 114: {fileID: 396492937} + - 114: {fileID: 396492940} + m_Layer: 0 + m_Name: Flowchart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &396492926 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1.0 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 892 + selectedBlock: {fileID: 396492930} + selectedCommands: + - {fileID: 396492940} + variables: + - {fileID: 396492928} + - {fileID: 396492927} + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: +--- !u!114 &396492927 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: OtherString + value: +--- !u!114 &396492928 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: TestString + value: +--- !u!114 &396492929 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c657364a3b24e16bdf5946729a8b7b, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 2 + errorMessage: + indentLevel: 0 + key: TestStringKey + variable: {fileID: 396492927} +--- !u!114 &396492930 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 209 + y: 111 + width: 120 + height: 40 + itemId: 0 + blockName: Start + description: + eventHandler: {fileID: 396492933} + commandList: + - {fileID: 396492936} + - {fileID: 396492932} + - {fileID: 396492931} + - {fileID: 396492929} + - {fileID: 396492939} + - {fileID: 396492937} + - {fileID: 396492938} + - {fileID: 396492934} + - {fileID: 396492940} +--- !u!114 &396492931 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1bef7966140464bd5a3ef4da2ff236b9, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 3 + errorMessage: + indentLevel: 0 + key: TestStringKey + variable: {fileID: 396492928} +--- !u!114 &396492932 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb77d0ce495044f6e9feb91b31798e8c, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 1 + errorMessage: + indentLevel: 0 + variable: {fileID: 396492928} + setOperator: 0 + booleanData: + booleanRef: {fileID: 0} + booleanVal: 0 + integerData: + integerRef: {fileID: 0} + integerVal: 0 + floatData: + floatRef: {fileID: 0} + floatVal: 0 + stringData: + stringRef: {fileID: 0} + stringVal: SomeValue +--- !u!114 &396492933 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 396492930} +--- !u!114 &396492934 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e1205d6641f2146b19d496037f937ba0, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 5 + errorMessage: + indentLevel: 0 + key: TestString +--- !u!4 &396492935 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + 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: [] + m_Father: {fileID: 911947602} + m_RootOrder: 0 +--- !u!114 &396492936 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e1205d6641f2146b19d496037f937ba0, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 4 + errorMessage: + indentLevel: 0 + key: TestString +--- !u!114 &396492937 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2dcb71131f45b47fead560a97ef55f1c, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 8 + errorMessage: + indentLevel: 1 + failMessage: Wrong string value +--- !u!114 &396492938 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 93cb9773f2ca04e2bbf7a68ccfc23267, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 7 + errorMessage: + indentLevel: 0 +--- !u!114 &396492939 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70c5622b8a80845c980954170295f292, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 6 + errorMessage: + indentLevel: 0 + compareOperator: 1 + variable: {fileID: 396492927} + booleanData: + booleanRef: {fileID: 0} + booleanVal: 0 + integerData: + integerRef: {fileID: 0} + integerVal: 0 + floatData: + floatRef: {fileID: 0} + floatVal: 0 + stringData: + stringRef: {fileID: 0} + stringVal: SomeValue +--- !u!114 &396492940 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 396492925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4920f47cde1a84b11ad07b7317568494, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 9 + errorMessage: + indentLevel: 0 --- !u!1 &646902073 GameObject: m_ObjectHideFlags: 1 @@ -154,7 +464,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Name: m_EditorClassIdentifier: - selectedFlowchart: {fileID: 1618689129} + selectedFlowchart: {fileID: 396492926} --- !u!4 &646902075 Transform: m_ObjectHideFlags: 1 @@ -235,6 +545,7 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 + m_TargetEye: 3 m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 @@ -325,7 +636,57 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 4 +--- !u!1 &911947601 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 911947602} + - 114: {fileID: 911947603} + m_Layer: 0 + m_Name: SaveLoadTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &911947602 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 911947601} + 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: 396492935} + m_Father: {fileID: 0} + m_RootOrder: 2 +--- !u!114 &911947603 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 911947601} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 5 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 0 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: --- !u!1 &1384749029 GameObject: m_ObjectHideFlags: 0 @@ -336,7 +697,7 @@ GameObject: - 4: {fileID: 1384749030} - 114: {fileID: 1384749031} m_Layer: 0 - m_Name: TestInvoke + m_Name: InvokeTest m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0