From 18d2518231ff58db039b593fbb319e955b0e2874 Mon Sep 17 00:00:00 2001 From: Sinai Date: Mon, 10 May 2021 23:09:21 +1000 Subject: [PATCH] Use the Member color for the member filter toggles, move InspectorManager --- src/Core/Utility/UnityHelpers.cs | 2 +- src/{Core => UI/Inspectors}/InspectorManager.cs | 0 src/UI/Inspectors/ReflectionInspector.cs | 5 +++-- src/UnityExplorer.csproj | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename src/{Core => UI/Inspectors}/InspectorManager.cs (100%) diff --git a/src/Core/Utility/UnityHelpers.cs b/src/Core/Utility/UnityHelpers.cs index f711fb9..2247bef 100644 --- a/src/Core/Utility/UnityHelpers.cs +++ b/src/Core/Utility/UnityHelpers.cs @@ -90,7 +90,7 @@ namespace UnityExplorer } /// - /// Assumes the string is a 6-digit RGB Hex color code, which it will parse into a UnityEngine.Color. + /// Assumes the string is a 6-digit RGB Hex color code (with optional leading #) which it will parse into a UnityEngine.Color. /// Eg, FF0000 -> RGBA(1,0,0,1) /// public static Color ToColor(this string _string) diff --git a/src/Core/InspectorManager.cs b/src/UI/Inspectors/InspectorManager.cs similarity index 100% rename from src/Core/InspectorManager.cs rename to src/UI/Inspectors/InspectorManager.cs diff --git a/src/UI/Inspectors/ReflectionInspector.cs b/src/UI/Inspectors/ReflectionInspector.cs index 8aef955..97105d6 100644 --- a/src/UI/Inspectors/ReflectionInspector.cs +++ b/src/UI/Inspectors/ReflectionInspector.cs @@ -426,9 +426,10 @@ namespace UnityExplorer.UI.Inspectors { var toggleObj = UIFactory.CreateToggle(parent, "Toggle_" + type, out Toggle toggle, out Text toggleText); UIFactory.SetLayoutElement(toggleObj, minHeight: 25, minWidth: width); - toggleText.text = $"{type}"; + var color = SignatureHighlighter.GetMemberInfoColor(type); + toggleText.text = $"{type}"; - toggle.graphic.TryCast().color = new Color(0.25f, 0.25f, 0.25f); + toggle.graphic.TryCast().color = color.ToColor() * 0.65f; MemberFlags flag; switch (type) diff --git a/src/UnityExplorer.csproj b/src/UnityExplorer.csproj index e11898f..fc27caf 100644 --- a/src/UnityExplorer.csproj +++ b/src/UnityExplorer.csproj @@ -250,7 +250,7 @@ - +