-
-
Save Novack/b2118d2d49f74bfbb90226d0dfdd7ce8 to your computer and use it in GitHub Desktop.
#unitytips: Hierarchy Window Group Header - http://diegogiacomelli.com.br/unitytips-hierarchy-window-group-header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEditor; | |
| [InitializeOnLoad] | |
| public class HierarchyWindowGroupHeader : Editor | |
| { | |
| static HierarchyWindowGroupHeader() | |
| { | |
| EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI; | |
| } | |
| static void HierarchyWindowItemOnGUI(int instanceID, Rect selectionRect) | |
| { | |
| var gameObject = EditorUtility.InstanceIDToObject(instanceID) as GameObject; | |
| if (gameObject != null && gameObject.name.StartsWith("---", System.StringComparison.Ordinal)) | |
| { | |
| EditorGUI.DrawRect(selectionRect, Color.gray); | |
| EditorGUI.DropShadowLabel(selectionRect, gameObject.name.Replace("-", "").ToUpperInvariant()); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment