Unity Hierarchy enhancement
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-25 23:17:18 -07:00
Editor more guard for refection 2026-10-26 06:55:08 +01:00
Runtime migrating to the new API 2026-09-10 07:25:38 +01:00
Samples~ backport comp icons 2026-10-12 07:17:05 +01:00
.gitattributes work but not nested... 2025-12-26 10:23:27 +00:00
.gitignore work but not nested... 2025-12-26 10:23:27 +00:00
CHANGELOG.md saints hierarchy 2026-10-26 03:56:35 +01:00
CHANGELOG.md.meta background color 2025-12-30 07:23:40 +00:00
Editor.meta work but not nested... 2025-12-26 10:23:27 +00:00
LICENSE Create LICENSE 2025-12-29 14:58:54 +08:00
LICENSE.meta add meta 2025-12-29 06:59:32 +00:00
package.json saints hierarchy 2026-10-26 03:56:35 +01:00
package.json.meta work but not nested... 2025-12-26 10:23:27 +00:00
README.md readme 2026-10-25 23:17:18 -07:00
README.md.meta preview popup 2025-12-29 06:39:21 +00:00
Runtime.meta script api for icon 2025-12-30 10:41:09 +00:00

Saints Hierarchy

unity_version openupm openupm

Unity Hierarchy enhancement. Use Alt+Left Mouse Button to select.

Features

  1. Support both new and legacy Hierarchy API (Unity 6k.6+ for new, others for legacy)
  2. Favorate GameObjects for quick access
  3. Scene quick switcher
  4. Draw indent guild
  5. Allow set icons (pre-set & custom)
  6. Auto set icons for camera, cavans, light, eventSystem & Wwise Initializer
  7. Prefab footer icon if you have custom icon set

Context Menu

...

Install

  • Using OpenUPM

    openupm add today.comes.saintshierarchy
    
  • Using git upm:

    add to Packages/manifest.json in your project

    {
        "dependencies": {
            "today.comes.saintshierarchy": "https://github.com/TylerTemp/SaintsHierarchy.git",
            // your other dependencies...
        }
    }
    
  • Using git upm (Unity UI):

    1. Window - Package Manager
    2. Click + button, Add package from git URL
    3. Enter the following URL:
    https://github.com/TylerTemp/SaintsHierarchy.git
    
  • Using a unitypackage:

    Go to the Release Page to download a desired version of unitypackage and import it to your project

  • Using a git submodule:

    git submodule add https://github.com/TylerTemp/SaintsHierarchy.git Packages/today.comes.saintshierarchy
    

Change Log

Add alternative right click context menu to:

  1. Hide menu you don't want
  2. Move menu into another submenu, even a submenu you created
  3. Rename menu name, custom icons
  4. Provide default icons for menu

Use Tools - Saints Hierarchy - Replace Context Menu to enable it

See the full change log

Config

This will automaticlly add indent tree, and icon for camera, light, canvas, event system, wwise

Tools - Saints Hierarchy - Disable Saints Hierarchy to disable this plugin

Favorite GameObjects

Drag & Drop GameObject from hierarchy to the top space to add it to favorite.

  • Clicking the favorited button to quickly arrive the object in hierarchy
  • Draging it to adjust the favorite items' order
  • Right click (or alt + click) the favorite button to change alias, icon, color, or remove it from favorite

You can disable this feature in Tools - Saints Hierarchy - Disable Favorites

By default, clicking the favorite gameObject will only expand and highlight you to the target. If you want to inspect it when clicking, use Tools - Saints Hierarchy - Favorite Click To Inspect

It by default save favorite configs to personal config. If you're a one-person-army, you can use Tools - Saints Hierarchy - Save Favorites To Project Config so this config can be tracked by your version control like git.

video

Quick Scene Selector

Clicking on a scene's name to quickly switch to another scene in this project. It lists scenes with order:

  1. Scene in build settings
  2. Scene in Addressable
  3. Scene in project

(You can disable this function in Tools - Saints Hierarchy - Disable Scene Selector)

video

Indent Guides

Tools - Saints Hierarchy - Indent Guides toggles tree connector lines in both the new and legacy Hierarchy. Enabled by default and saved in the active project or personal config.

Lines use the corresponding parent's configured color. The new Hierarchy hides guides while filtering search results.

Background Strip (Legacy)

This is legacy only. new Hierarchy by default uses background strip which is controlled by Unity.

Tools - Saints Hierarchy - Background Strip

Component Icons

Tools - Saints Hierarchy - Component Icons

You can set the script icon and show the icons at the end of row

Use Alt + left click on a component icon to open that component's properties popup. You can also toggle Behaviour.enabled for Behaviour components.

Disabled Behaviour component icons are dimmed.

You can also use Tools - Saints Hierarchy - Component Icons For General Scripts and Tools - Saints Hierarchy - Component Icons For Transform to control whether default script icons and Transform icons are shown.

Setup:

Result:

Alt-Click popup inspector:

New: Hierarchy Menu (3-dots) - Components(SH) allows to show as a column (use click instead of alt-click). You can decide which style you like.

Layer/Tag Picker

Quick change Layer/Tag, and search GameObject for that Layer/Tag.

New Hierarchy

Unity default layer/tag has no search ability. To use layer/tag picker with searcher, do: Hierarchy Menu (3-dots) - Layer (SH)/Tag (SH)

Legacy Hierarchy

Note: legacy hierarchy does not support tag/layer search, so we use Unity's built-in QuickSearch instead

Tools - Saints Hierarchy - Edit Config... and set layer/tag options

GameObject Enabled Checker (Legacy)

New: Unity already has this feature.

Tools - Saints Hierarchy - GameObject Enabled Checker

Add a checkbox at the end for gameObject which has any disabled parent gameObjects, to quickly toggle it back.

Alternative Context Menu

Replace Unity's default right click popup menu to new style menu which supports:

  1. Search
  2. Re-Organization
  3. Hide
  4. Default Icons + Allow Custom Icons
  5. Customize!

You can easily search menu items using ctrl/cmd+f

You can easily customize it

Or disable it if you do not like it in Tools - Saints Hierarchy - Replace Context Menu

Usage

GameObject Icon

GameObject icon (including custom icons) will be used as hierarchy icon:

Result:

GameObject label will be used as hierarchy label underline:

Result:

Color

  1. select a color to change
  2. use x button to clean the color config
  3. use the color picker (second button) to manually change the color you want

Custom Icon

  1. select an icon to change
  2. to use your custom icon, first right click on you icon - copy path, then paste it into the search field. The icon will appear as the first item on the result
  3. select the same icon to remove icon config

Scripted Icon

public class HierarchyIconPathExample : MonoBehaviour, IHierarchyIconPath
{
    public string HierarchyIconPath => "CollabChanges Icon";  // return a path or name of the icon
}

Or

public class HierarchyIconTexture2DExample: MonoBehaviour, IHierarchyIconTexture2D
{
    public Texture2D texture2D;
#if UNITY_EDITOR
    public Texture2D HierarchyIconTexture2D => texture2D;  // return a texture2D object; null to use default behavor
#endif
}

HierarchyLabel/HierarchyLeftLabel

Draw label. Callback & tag supported.

Parameters:

  • string label = null: label to draw. Use "$" + name to make a callback/property
  • string tooltip = null: tooltip to show
using SaintsHierarchy;

[HierarchyLabel("<color=CadetBlue><field/>")]
[HierarchyLeftLabel("<color=CadetBlue>|LEFT|")]
public string content;

HierarchyButton/HierarchyLeftButton/HierarchyGhostButton/HierarchyGhostLeftButton

Draw button. Callback & tag supported.

Parameters:

  • string label = null: label of the button. null to use function name. use "$" + name to use a callback label
  • string tooltip = null: tooltip to show
using SaintsHierarchy;

public string c;

[HierarchyGhostButton("$" + nameof(c), "Click Me!")]  // dynamic label
private void OnBtnClick()
{
    Debug.Log($"click {c}");
}

[HierarchyLeftButton("C <color=Burlywood>Left")]
private void LeftClick()
{
    Debug.Log("Left Click");
}

HierarchyDraw/HierarchyLeftDraw

Manually draw content using UI Toolkit in the new Hierarchy or IMGUI in the legacy Hierarchy.

New (UI Toolkit)

Parameters:

  • string groupBy = null: stack consecutive items with the same group name vertically on their chosen side. If null, each item uses its own space.

Use a method returning a VisualElement or HierarchyArea:

VisualElement FuncName()
HierarchyArea FuncName()

HierarchyArea has the following fields for the new Hierarchy:

// The UI Toolkit element to display.
public readonly VisualElement Element;
// true to display in the left custom container; false for the right.
public readonly bool IsLeft;

Return new HierarchyArea(element) or a VisualElement directly to display on the right

Return new HierarchyArea(true, element) to display on the left

Return null for a VisualElement, or default for a HierarchyArea, to display nothing

using SaintsHierarchy;
using UnityEngine;
#if UNITY_EDITOR
using UnityEngine.UIElements;
#endif

public class CustomHierarchyExample : MonoBehaviour
{
    [Range(0f, 1f)] public float progress;

#if UNITY_EDITOR
    [HierarchyDraw]
    private VisualElement DrawProgress()
    {
        var bar = new ProgressBar
        {
            lowValue = 0,
            highValue = 1,
            value = progress,
            style = { width = 80, height = 16, flexShrink = 0 },
        };
        bar.schedule.Execute(() => bar.value = progress).Every(100);
        return bar;
    }

    [HierarchyLeftDraw]
    private HierarchyArea DrawLeft()
    {
        return new HierarchyArea(true, new Label("Left"));
    }
#endif
}

Legacy (IMGUI)

Parameters:

  • string groupBy = null: group the items vertically by this name. If null, it will not share space with anyone.

Signature:

The method must have this signature:

HierarchyUsed FuncName(HierarchyArea hierarchyArea)

HierarchyArea has the following fields and helpers for the legacy Hierarchy:

/// <summary>
/// Rect.y for drawing
/// </summary>
public readonly float Y;
/// <summary>
/// Rect.height for drawing
/// </summary>
public readonly float Height;
/// <summary>
/// the x value where the title (gameObject name) started
/// </summary>
public readonly float TitleStartX;
/// <summary>
/// the x value where the title (gameObject name) ended
/// </summary>
public readonly float TitleEndX;
/// <summary>
/// the x value where the empty space start. You may want to start draw here
/// </summary>
public readonly float SpaceStartX;
/// <summary>
/// the x value where the empty space ends. When drawing from right, you need to backward drawing starts here
/// </summary>
public readonly float SpaceEndX;

/// <summary>
/// The x drawing position. It's recommend to use this as your start drawing point, as SaintsHierarchy will
/// change this value accordingly everytime an item is drawn.
/// </summary>
public readonly float GroupStartX;
/// <summary>
/// When using `GroupBy`, you can see the vertical rect which already used by others in this group
/// </summary>
public readonly IReadOnlyList<Rect> GroupUsedRect;

public float TitleWidth => TitleEndX - TitleStartX;
public float SpaceWidth => SpaceEndX - SpaceStartX;

/// <summary>
/// A quick way to make a rect
/// </summary>
/// <param name="x">where to start</param>
/// <param name="width">width of the rect</param>
/// <returns>rect space you want to draw</returns>
public Rect MakeXWidthRect(float x, float width)
{
    if(width >= 0)
    {
        return new Rect(x, Y, width, Height);
    }
    return new Rect(x + width, Y, -width, Height);
}

After you draw your item, use return new HierarchyUsed(useRect); to tell the space you've used. Use return default if you don't draw this time.

public bool play;
[Range(0f, 1f)] public float range1;
[Range(0f, 1f)] public float range2;

private string ButtonLabel => play ? "Pause" : "Play";

#if UNITY_EDITOR
[HierarchyLeftButton("$" + nameof(ButtonLabel))]
private IEnumerator LeftBtn()
{
    play = !play;
    // ReSharper disable once InvertIf
    if (play)
    {
        while (play)
        {
            range1 = (range1 + 0.0005f) % 1;
            range2 = (range2 + 0.0009f) % 1;
            EditorApplication.RepaintHierarchyWindow();
            yield return null;
        }
    }
}

[HierarchyDraw("my progress bar")]
private HierarchyUsed DrawRight1G1(HierarchyArea headerArea)
{
    Rect useRect = new Rect(headerArea.MakeXWidthRect(headerArea.GroupStartX - 40, 40))
    {
        height = headerArea.Height / 2,
    };
    Rect progressRect = new Rect(useRect)
    {
        width = range1 * useRect.width,
    };

    EditorGUI.DrawRect(useRect, Color.gray);
    EditorGUI.DrawRect(progressRect, Color.red);

    return new HierarchyUsed(useRect);
}
[HierarchyDraw("my progress bar")]
private HierarchyUsed DrawRight1G2(HierarchyArea headerArea)
{
    Rect useRect = new Rect(headerArea.MakeXWidthRect(headerArea.GroupStartX - 40, 40))
    {
        y = headerArea.Y + headerArea.Height / 2,
        height = headerArea.Height / 2,
    };
    Rect progressRect = new Rect(useRect)
    {
        width = range2 * useRect.width,
    };

    EditorGUI.DrawRect(useRect, Color.gray);
    EditorGUI.DrawRect(progressRect, Color.yellow);

    return new HierarchyUsed(useRect);
}
#endif

Package is too simple

Your asset was reviewed by the Unity Content Operation team, and was not approved for the following reason(s): - Content Quality and Presentation. This package is too simple for our current standards (https://assetstore.unity.com/publishing/submission-guidelines, Section 1.1.a). Please spend more time researching the current game market, polishing and tweaking your package to a high degree of quality, and expanding its contents to reach a broader audience. We recommend visiting the Asset Store Forums so users may give you more feedback (https://forum.unity.com/forums/assets-and-asset-store.32/) and reading the Submission Guidelines (https://assetstore.unity.com/publishing/submission-guidelines). Until you make improvements, we have chosen not to publish this asset. However, we greatly appreciate the time and effort spent in preparing your submission. This restriction was made as the asset is not compliant with our content policy (https://unity.com/legal/asset-store-content-transparency). If you are based in the EU, you can see your redress options under the Digital Services Act in the Redress Options section (https://unity.com/legal/asset-store-content-transparency#redress-options).

image