diff --git a/CHANGELOG.md b/CHANGELOG.md index 92b1485..c129c7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.2.0 +- Components that have the `HideFlags.HideInInspector` argument in the Script will now be hidden by default. This fixes a bug where those hidden Components were exposed in the Hierarchy when they were not supposed to. + - You can show them again in the Hierarchy by toggling "Show Hidden Components" in the BluHierarchy Settings, if for some weird reason you want to see them. ¯\_(ツ)_/¯ + # v1.1.0 - Redesigned ALL icons for better clarity on the Hierarchy. The edgy file-like icons were getting a bit old... - Added icon for d4rkAvatarOptimizer. diff --git a/Editor/BluHierarchy.cs b/Editor/BluHierarchy.cs index ca639a2..6535570 100644 --- a/Editor/BluHierarchy.cs +++ b/Editor/BluHierarchy.cs @@ -98,6 +98,8 @@ void OnGUI() bool currentShowTransformIcon = BluHierarchySettings.ShowTransformIcon; bool newShowTransformIcon = EditorGUILayout.Toggle("Show Transform Icon", currentShowTransformIcon); bool currentShowLayerIcon = BluHierarchySettings.ShowLayerIcon; + bool currentShowHiddenComponents = BluHierarchySettings.ShowHiddenComponents; + bool newShowHiddenComponents = EditorGUILayout.Toggle("Show Hidden Components", currentShowHiddenComponents); if (newShowTransformIcon != currentShowTransformIcon) { @@ -111,6 +113,12 @@ void OnGUI() EditorPrefs.SetBool("BluHierarchy_ShowLayerIcon", BluHierarchySettings.ShowLayerIcon); RepaintHierarchyWindow(); } + + if (newShowHiddenComponents != currentShowHiddenComponents) + { + BluHierarchySettings.ShowHiddenComponents = newShowHiddenComponents; + RepaintHierarchyWindow(); + } } } @@ -149,6 +157,7 @@ public static class BluHierarchySettings { private const string ShowTransformIconKey = "BluHierarchy_ShowTransformIcon"; private const string ShowLayerIconKey = "BluHierarchy_ShowLayerIcon"; + private const string ShowHiddenComponentsKey = "BluHierarchy_ShowHiddenComponents"; public static bool ShowTransformIcon { @@ -161,6 +170,12 @@ public static bool ShowLayerIcon get => EditorPrefs.GetBool(ShowLayerIconKey, false); set => EditorPrefs.SetBool(ShowLayerIconKey, value); } + + public static bool ShowHiddenComponents + { + get => EditorPrefs.GetBool(ShowHiddenComponentsKey, false); + set => EditorPrefs.SetBool(ShowHiddenComponentsKey, value); + } } public static void RepaintHierarchyWindow() @@ -258,6 +273,8 @@ private static void OnHierarchyGUI(int instanceID, Rect selectionRect) if (component == null) continue; + if (!BluHierarchySettings.ShowHiddenComponents && (component.hideFlags & HideFlags.HideInInspector) != 0) continue; + if (component is Transform && !BluHierarchySettings.ShowTransformIcon) continue; Texture2D icon = null; diff --git a/package.json b/package.json index 3a2af33..bb8981d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "net.bluwizard.hierarchy", - "version": "1.1.0", + "version": "1.2.0", "displayName": "BluWizard LABS - Enhanced Hierarchy System", "unity": "2019.4", "description": "Blu's personal editor enhancement system that introduces an improved Hierarchy look, tailored made for VRChat Creators.",