Skip to content

Commit

Permalink
add commented out test for hierarchy indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst authored and kipash committed Jun 26, 2024
1 parent 2f7f546 commit 168b652
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions package/Runtime/_Internal/RequirePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,34 @@ namespace Needle.Engine
internal class RequirePackage : MonoBehaviour
{
public string packageName;

/*
[InitializeOnLoadMethod]
private static void AddHierarchyIndicator()
{
var backgroundColor = EditorGUIUtility.isProSkin ? new Color32(56, 56, 56, 255) : new Color32(194, 194, 194, 255);
EditorApplication.hierarchyWindowItemOnGUI += (instanceID, rect) =>
{
var isSelected = Selection.activeInstanceID == instanceID;
if (isSelected) return;
var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject;
if (go && go.GetComponent<RequirePackage>())
{
var c = GUI.color;
GUI.color *= backgroundColor;
GUI.DrawTexture(rect, EditorGUIUtility.whiteTexture);
var r = new Rect(rect);
r.x = r.x - 0;
r.width = 16;
GUI.color = Color.yellow;
GUI.Label(r, "⚠");
rect.xMin += 16;
GUI.Label(rect, "Package required");
GUI.color = c;
}
};
}
*/
}

#if UNITY_EDITOR
Expand Down

0 comments on commit 168b652

Please sign in to comment.