Skip to content

Commit

Permalink
Release v1.2.0
Browse files Browse the repository at this point in the history
Components that have the HideFlags.HideInInspector argument are now hidden by default.

Added Setting that controls the visibility of hidden components, for some reason.
  • Loading branch information
BluWizard10 committed Dec 21, 2024
1 parent 5ebf009 commit c028f3c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
17 changes: 17 additions & 0 deletions Editor/BluHierarchy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -111,6 +113,12 @@ void OnGUI()
EditorPrefs.SetBool("BluHierarchy_ShowLayerIcon", BluHierarchySettings.ShowLayerIcon);
RepaintHierarchyWindow();
}

if (newShowHiddenComponents != currentShowHiddenComponents)
{
BluHierarchySettings.ShowHiddenComponents = newShowHiddenComponents;
RepaintHierarchyWindow();
}
}
}

Expand Down Expand Up @@ -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
{
Expand All @@ -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()
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down

0 comments on commit c028f3c

Please sign in to comment.