diff --git a/Assets/Fungus/Scripts/Editor/HierarchyIcons.cs b/Assets/Fungus/Scripts/Editor/HierarchyIcons.cs index 4543c14a..1c681464 100644 --- a/Assets/Fungus/Scripts/Editor/HierarchyIcons.cs +++ b/Assets/Fungus/Scripts/Editor/HierarchyIcons.cs @@ -25,8 +25,11 @@ namespace Fungus //sorted list of the GO instance IDs that have flowcharts on them static List flowchartIDs = new List(); + static bool initalHierarchyCheckFlag = true; + static HierarchyIcons() - { + { + initalHierarchyCheckFlag = true; EditorApplication.hierarchyWindowItemOnGUI += HierarchyIconCallback; EditorApplication.hierarchyChanged += HierarchyChanged; } @@ -48,6 +51,12 @@ namespace Fungus //Draw icon if the isntance id is in our cached list static void HierarchyIconCallback(int instanceID, Rect selectionRect) { + if(initalHierarchyCheckFlag) + { + HierarchyChanged(); + initalHierarchyCheckFlag = false; + } + if (EditorUtils.FungusEditorPreferences.hideMushroomInHierarchy) return;