https://github.com/tylertemp/saintshierarchy
Unity Hierarchy enhancement
https://github.com/tylertemp/saintshierarchy
unity unity-editor unity-hierarchy
Last synced: about 17 hours ago
JSON representation
Unity Hierarchy enhancement
- Host: GitHub
- URL: https://github.com/tylertemp/saintshierarchy
- Owner: TylerTemp
- License: mit
- Created: 2025-12-26T10:24:01.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2026-06-26T02:33:09.000Z (7 days ago)
- Last Synced: 2026-06-26T04:10:09.393Z (7 days ago)
- Topics: unity, unity-editor, unity-hierarchy
- Language: C#
- Homepage:
- Size: 727 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Saints Hierarchy #
[](https://unity.com/download)
[](https://openupm.com/packages/today.comes.saintshierarchy/)
[](https://openupm.com/packages/today.comes.saintshierarchy/)
Unity Hierarchy enhancement. Use `Alt`+`Left Mouse Button` to select.

## Features ##
1. Favorate GameObjects for quick access
2. Scene quick switcher
3. Draw indent guild
4. Allow set icons (pre-set & custom)
5. Auto set icons for camera, cavans, light, eventSystem & Wwise Initializer
6. Prefab footer icon if you have custom icon set
## Install ##
* Using [OpenUPM](https://openupm.com/packages/today.comes.saintsfield/)
```bash
openupm add today.comes.saintshierarchy
```
* Using git upm:
add to `Packages/manifest.json` in your project
```javascript
{
"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](https://github.com/TylerTemp/SaintsHierarchy/releases) to download a desired version of `unitypackage` and import it to your project
* Using a git submodule:
```bash
git submodule add https://github.com/TylerTemp/SaintsHierarchy.git Packages/today.comes.saintshierarchy
```
## Change Log ##
Fix: Delay injection when entering play mode to reduce unnecessary errors
See [the full change log](https://github.com/TylerTemp/SaintsHierarchy/blob/master/CHANGELOG.md)
## 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.
[](https://github.com/user-attachments/assets/6176d57b-4b84-46a4-8384-f231b339ebca)
### 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`)
[](https://github.com/user-attachments/assets/be2d2704-fe91-4322-8dfb-c16688f9184d)
### Background Strip ###
`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:

### GameObject Enabled Checker ###
`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.

## 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 ###
```csharp
public class HierarchyIconPathExample : MonoBehaviour, IHierarchyIconPath
{
public string HierarchyIconPath => "CollabChanges Icon"; // return a path or name of the icon
}
```
Or
```csharp
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
```csharp
using SaintsHierarchy;
[HierarchyLabel("")]
[HierarchyLeftLabel("|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
```csharp
using SaintsHierarchy;
public string c;
[HierarchyGhostButton("$" + nameof(c), "Click Me!")] // dynamic label
private void OnBtnClick()
{
Debug.Log($"click {c}");
}
[HierarchyLeftButton("C Left")]
private void LeftClick()
{
Debug.Log("Left Click");
}
```

### `HierarchyDraw`/`HierarchyLeftDraw` ###
Manually draw content
Parameters:
* `string groupBy = null`: group the items virtically by this name. If `null`, it will not share space with anyone.
Signature:
The method must have this signaure:
```csharp
HierarchyUsed FuncName(HierarchyArea hierarchyArea)
```
`HierarchyArea` has the following fields:
```csharp
///
/// Rect.y for drawing
///
public readonly float Y;
///
/// Rect.height for drawing
///
public readonly float Height;
///
/// the x value where the title (gameObject name) started
///
public readonly float TitleStartX;
///
/// the x value where the title (gameObject name) ended
///
public readonly float TitleEndX;
///
/// the x value where the empty space start. You may want to start draw here
///
public readonly float SpaceStartX;
///
/// the x value where the empty space ends. When drawing from right, you need to backward drawing starts here
///
public readonly float SpaceEndX;
///
/// 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.
///
public readonly float GroupStartX;
///
/// When using `GroupBy`, you can see the vertical rect which already used by others in this group
///
public readonly IReadOnlyList GroupUsedRect;
public float TitleWidth => TitleEndX - TitleStartX;
public float SpaceWidth => SpaceEndX - SpaceStartX;
///
/// A quick way to make a rect
///
/// where to start
/// width of the rect
/// rect space you want to draw
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.
```csharp
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
```
[](https://github.com/user-attachments/assets/260c9661-e7c2-4e0f-b666-a36287fe9eb4)