From 875b5f190f2a8fe870fc18a33b908c2004dca9e1 Mon Sep 17 00:00:00 2001 From: Christopher Date: Fri, 17 Jun 2016 11:44:07 +0100 Subject: [PATCH] Fixed aliased commandIndex property in Call. --- Assets/Fungus/Flowchart/Editor/CallEditor.cs | 6 +++--- Assets/Fungus/Flowchart/Scripts/Commands/Call.cs | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Assets/Fungus/Flowchart/Editor/CallEditor.cs b/Assets/Fungus/Flowchart/Editor/CallEditor.cs index 0db4cb83..82971aae 100644 --- a/Assets/Fungus/Flowchart/Editor/CallEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/CallEditor.cs @@ -10,7 +10,7 @@ namespace Fungus { protected SerializedProperty targetFlowchartProp; protected SerializedProperty targetBlockProp; - protected SerializedProperty commandIndexProp; + protected SerializedProperty startIndexProp; protected SerializedProperty callModeProp; protected virtual void OnEnable() @@ -20,7 +20,7 @@ namespace Fungus targetFlowchartProp = serializedObject.FindProperty("targetFlowchart"); targetBlockProp = serializedObject.FindProperty("targetBlock"); - commandIndexProp = serializedObject.FindProperty("commandIndex"); + startIndexProp = serializedObject.FindProperty("startIndex"); callModeProp = serializedObject.FindProperty("callMode"); } @@ -49,7 +49,7 @@ namespace Fungus new GUIContent(""), flowchart); - EditorGUILayout.PropertyField(commandIndexProp); + EditorGUILayout.PropertyField(startIndexProp); } EditorGUILayout.PropertyField(callModeProp); diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/Call.cs b/Assets/Fungus/Flowchart/Scripts/Commands/Call.cs index 13bc53f1..4fb5f7e9 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/Call.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/Call.cs @@ -21,7 +21,8 @@ namespace Fungus public Block targetBlock; [Tooltip("Command index to start executing")] - public int commandIndex; + [FormerlySerializedAs("commandIndex")] + public int startIndex; public enum CallMode { @@ -67,12 +68,12 @@ namespace Fungus flowchart.selectedBlock = targetBlock; } - StartCoroutine(targetBlock.Execute(commandIndex, onComplete)); + StartCoroutine(targetBlock.Execute(startIndex, onComplete)); } else { // Execute block in another Flowchart - targetFlowchart.ExecuteBlock(targetBlock, commandIndex, onComplete); + targetFlowchart.ExecuteBlock(targetBlock, startIndex, onComplete); } }