diff --git a/src/Core/Reflection/ReflectionUtility.cs b/src/Core/Reflection/ReflectionUtility.cs index ac2fb21..4eb7bce 100644 --- a/src/Core/Reflection/ReflectionUtility.cs +++ b/src/Core/Reflection/ReflectionUtility.cs @@ -42,7 +42,7 @@ namespace UnityExplorer public static Action OnTypeLoaded; /// Key: Type.FullName - public static readonly SortedDictionary AllTypes = new SortedDictionary(StringComparer.OrdinalIgnoreCase); + protected static readonly SortedDictionary AllTypes = new SortedDictionary(StringComparer.OrdinalIgnoreCase); public static readonly List AllNamespaces = new List(); private static readonly HashSet uniqueNamespaces = new HashSet(); diff --git a/src/UI/ObjectExplorer/ObjectSearch.cs b/src/UI/ObjectExplorer/ObjectSearch.cs index eec0d08..d67b24d 100644 --- a/src/UI/ObjectExplorer/ObjectSearch.cs +++ b/src/UI/ObjectExplorer/ObjectSearch.cs @@ -76,7 +76,7 @@ namespace UnityExplorer.UI.ObjectExplorer lastCheckedTypeInput = desiredTypeInput; //var type = ReflectionUtility.GetTypeByName(desiredTypeInput); - if (ReflectionUtility.AllTypes.TryGetValue(desiredTypeInput, out var cachedType)) + if (ReflectionUtility.GetTypeByName(desiredTypeInput) is Type cachedType) { var type = cachedType; lastTypeCanHaveGO = typeof(Component).IsAssignableFrom(type) || type == typeof(GameObject); diff --git a/src/UI/Widgets/AutoComplete/TypeCompleter.cs b/src/UI/Widgets/AutoComplete/TypeCompleter.cs index df83c2c..8c69b95 100644 --- a/src/UI/Widgets/AutoComplete/TypeCompleter.cs +++ b/src/UI/Widgets/AutoComplete/TypeCompleter.cs @@ -87,7 +87,7 @@ namespace UnityExplorer.UI.Widgets.AutoComplete } // Check for exact match first - if (ReflectionUtility.AllTypes.TryGetValue(value, out Type t) && allowedTypes.Contains(t)) + if (ReflectionUtility.GetTypeByName(value) is Type t && allowedTypes.Contains(t)) AddSuggestion(t); foreach (var entry in allowedTypes)