From 168b652d8ea8eeaca782d8e5c4c62229bea7c7dd Mon Sep 17 00:00:00 2001 From: hybridherbst Date: Tue, 25 Jun 2024 12:21:34 +0200 Subject: [PATCH] add commented out test for hierarchy indicator --- package/Runtime/_Internal/RequirePackage.cs | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/package/Runtime/_Internal/RequirePackage.cs b/package/Runtime/_Internal/RequirePackage.cs index d1ca75716..8f0351344 100644 --- a/package/Runtime/_Internal/RequirePackage.cs +++ b/package/Runtime/_Internal/RequirePackage.cs @@ -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()) + { + 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