|
|
@ -98,7 +98,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
DrawEventHandlerGUI(flowchart); |
|
|
|
DrawEventHandlerGUI(flowchart); |
|
|
|
|
|
|
|
|
|
|
|
UpdateIndentLevels(block); |
|
|
|
block.UpdateIndentLevels(); |
|
|
|
|
|
|
|
|
|
|
|
// Make sure each command has a reference to its parent block |
|
|
|
// Make sure each command has a reference to its parent block |
|
|
|
foreach (Command command in block.commandList) |
|
|
|
foreach (Command command in block.commandList) |
|
|
@ -404,33 +404,6 @@ namespace Fungus |
|
|
|
PrefabUtility.RecordPrefabInstancePropertyModifications(block); |
|
|
|
PrefabUtility.RecordPrefabInstancePropertyModifications(block); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected virtual void UpdateIndentLevels(Block block) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int indentLevel = 0; |
|
|
|
|
|
|
|
foreach(Command command in block.commandList) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (command == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (command.CloseBlock()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
indentLevel--; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Negative indent level is not permitted |
|
|
|
|
|
|
|
indentLevel = Math.Max(indentLevel, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
command.indentLevel = indentLevel; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (command.OpenBlock()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
indentLevel++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static public void BlockField(SerializedProperty property, GUIContent label, GUIContent nullLabel, Flowchart flowchart) |
|
|
|
static public void BlockField(SerializedProperty property, GUIContent label, GUIContent nullLabel, Flowchart flowchart) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (flowchart == null) |
|
|
|
if (flowchart == null) |
|
|
|