Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 601567f

Browse files
committed
Remove arbitrary static restriction on class search
1 parent 7ff508b commit 601567f

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/ObjectExplorer/ObjectSearch.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public void DoSearch()
5353

5454
if (m_context == SearchContext.Singleton)
5555
currentResults = SearchProvider.SingletonSearch(nameInputField.Text);
56-
else if (m_context == SearchContext.StaticClass)
57-
currentResults = SearchProvider.StaticClassSearch(nameInputField.Text);
56+
else if (m_context == SearchContext.Class)
57+
currentResults = SearchProvider.ClassSearch(nameInputField.Text);
5858
else
5959
{
6060
string compType = "";
@@ -130,7 +130,7 @@ public void SetCell(ButtonCell cell, int index)
130130
if (!cachedCellTexts.ContainsKey(index))
131131
{
132132
string text;
133-
if (m_context == SearchContext.StaticClass)
133+
if (m_context == SearchContext.Class)
134134
text = SignatureHighlighter.Parse(currentResults[index] as Type, true);
135135
else
136136
text = ToStringUtility.ToStringWithType(currentResults[index], currentResults[index]?.GetActualType());
@@ -143,7 +143,7 @@ public void SetCell(ButtonCell cell, int index)
143143

144144
private void OnCellClicked(int dataIndex)
145145
{
146-
if (m_context == SearchContext.StaticClass)
146+
if (m_context == SearchContext.Class)
147147
InspectorManager.Inspect(currentResults[dataIndex] as Type);
148148
else
149149
InspectorManager.Inspect(currentResults[dataIndex]);

src/ObjectExplorer/SearchProvider.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ namespace UnityExplorer.ObjectExplorer
1313
public enum SearchContext
1414
{
1515
UnityObject,
16-
// GameObject,
1716
Singleton,
18-
StaticClass
17+
Class
1918
}
2019

2120
public enum ChildFilter
@@ -134,7 +133,7 @@ internal static List<object> UnityObjectSearch(string input, string customTypeIn
134133
return results;
135134
}
136135

137-
internal static List<object> StaticClassSearch(string input)
136+
internal static List<object> ClassSearch(string input)
138137
{
139138
var list = new List<object>();
140139

@@ -144,11 +143,10 @@ internal static List<object> StaticClassSearch(string input)
144143

145144
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
146145
{
147-
foreach (var type in asm.TryGetTypes().Where(it => it.IsSealed && it.IsAbstract))
146+
foreach (var type in asm.TryGetTypes())
148147
{
149148
if (!string.IsNullOrEmpty(nameFilter) && !type.FullName.ContainsIgnoreCase(nameFilter))
150149
continue;
151-
152150
list.Add(type);
153151
}
154152
}

0 commit comments

Comments
 (0)