SHARE
TWEET

Untitled

a guest Jul 17th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using UnityEditor;
  3. [InitializeOnLoad]
  4. public static class HierarchyHeader
  5. {
  6.     static HierarchyHeader()
  7.     {
  8.         EditorApplication.hierarchyWindowItemOnGUI += HierarchyItem;
  9.     }
  10.  
  11.     static void HierarchyItem(int instanceID, Rect selectionRect)
  12.     {
  13.         var gameObject = EditorUtility.InstanceIDToObject(instanceID) as GameObject;
  14.         if (gameObject != null)
  15.         {
  16.             if (gameObject.GetComponent("EditorItem"))
  17.             {
  18.  
  19.                 EditorGUI.DrawRect(selectionRect, gameObject.GetComponent<EditorItem>() .color);
  20.             }
  21.             if (gameObject.name.StartsWith("---", System.StringComparison.Ordinal))
  22.             {
  23.                 EditorGUI.DrawRect(selectionRect, Color.gray);
  24.             }
  25.         }
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top