diff --git a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs index 4689de23..e1cb01f8 100644 --- a/Assets/Fungus/Flowchart/Editor/BlockEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/BlockEditor.cs @@ -399,6 +399,9 @@ namespace Fungus newHandler.parentBlock = block; block.eventHandler = newHandler; } + + // Because this is an async call, we need to force prefab instances to record changes + PrefabUtility.RecordPrefabInstancePropertyModifications(block); } protected virtual void UpdateIndentLevels(Block block) @@ -764,6 +767,9 @@ namespace Fungus { block.commandList.Add(newCommand); } + + // Because this is an async call, we need to force prefab instances to record changes + PrefabUtility.RecordPrefabInstancePropertyModifications(block); } public virtual void ShowContextMenu() @@ -968,6 +974,9 @@ namespace Fungus } } + // Because this is an async call, we need to force prefab instances to record changes + PrefabUtility.RecordPrefabInstancePropertyModifications(block); + Repaint(); } diff --git a/Assets/Fungus/Flowchart/Editor/FlowchartEditor.cs b/Assets/Fungus/Flowchart/Editor/FlowchartEditor.cs index 77207e5d..c509c15c 100644 --- a/Assets/Fungus/Flowchart/Editor/FlowchartEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/FlowchartEditor.cs @@ -229,6 +229,9 @@ namespace Fungus Variable newVariable = flowchart.gameObject.AddComponent(variableType) as Variable; newVariable.key = flowchart.GetUniqueVariableKey(""); flowchart.variables.Add(newVariable); + + // Because this is an async call, we need to force prefab instances to record changes + PrefabUtility.RecordPrefabInstancePropertyModifications(flowchart); } public static List FindAllDerivedTypes()