Browse Source

Merge pull request #672 from stevehalliwell/ForceHierarchyIconRefresh

Force the hierarchy icon list to refresh when a script a is loaded/ch…
master
Chris Gregan 7 years ago committed by GitHub
parent
commit
f55d0442dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      Assets/Fungus/Scripts/Editor/HierarchyIcons.cs

9
Assets/Fungus/Scripts/Editor/HierarchyIcons.cs

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

Loading…
Cancel
Save