Skip to content

Commit f301bda

Browse files
committed
fix: Fixed missing type exception when drawing a generic object selector in Unity 2020
Disabled ObjectSelectorSearch.HasEngineOverride altogether because it doesn't seem to be needed for drawing generic unity objects, but it causes issues with compatibility between Unity 2020 and 2021.
1 parent 8dde5cb commit f301bda

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

GenericUnityEditorInternals.dll

-1.5 KB
Binary file not shown.

GenericUnityInternals~/GenericUnityEditorInternals/ObjectSelectorExtensions.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ public static void ShowGeneric(this ObjectSelector this_, Object obj, Object obj
6767
this_.m_ModalUndoGroup = Undo.GetCurrentGroup();
6868

6969
// Show custom selector if available
70-
if (ObjectSelectorSearch.HasEngineOverride())
70+
71+
// It seems this branch isn't used for generic unity objects, but it causes issues because ObjectSelectorSearch
72+
// is named differently in Unity2020 and 2021. Disabling it doesn't seem to break anything.
73+
/*if (ObjectSelectorSearch.HasEngineOverride())
7174
{
7275
this_.m_SearchSessionHandler.BeginSession(() =>
7376
{
@@ -119,7 +122,7 @@ void OnSelectorClosed(Object selectedObj, bool canceled)
119122
120123
if (ObjectSelectorSearch.SelectObject(searchContext, OnSelectorClosed, OnSelectionChanged))
121124
return;
122-
}
125+
}*/
123126

124127
// Freeze to prevent flicker on OSX.
125128
// Screen will be updated again when calling

0 commit comments

Comments
 (0)