File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
Assets/Editor Toolbox/Editor Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ internal static void InitializeModule()
23
23
ToolboxEditorHandler . OnEditorReload += ReloadDrawers ;
24
24
}
25
25
26
-
27
26
private static readonly Type decoratorDrawerBase = typeof ( ToolboxDecoratorDrawer < > ) ;
28
27
private static readonly Type conditionDrawerBase = typeof ( ToolboxConditionDrawer < > ) ;
29
28
private static readonly Type selfPropertyDrawerBase = typeof ( ToolboxSelfPropertyDrawer < > ) ;
@@ -261,11 +260,25 @@ internal static void UpdateDrawers(IToolboxInspectorSettings settings)
261
260
/// </summary>
262
261
internal static bool HasNativeTypeDrawer ( Type type )
263
262
{
264
- #if UNITY_2023_3_OR_NEWER
265
- var parameters = new object [ ] { type , null , false } ;
266
- #else
267
- var parameters = new object [ ] { type } ;
268
- #endif
263
+ object [ ] parameters ;
264
+ var parameterInfos = getDrawerTypeForTypeMethod . GetParameters ( ) ;
265
+ var parametersCount = parameterInfos . Length ;
266
+ switch ( parametersCount )
267
+ {
268
+ default :
269
+ case 1 :
270
+ parameters = new object [ ] { type } ;
271
+ break ;
272
+ //NOTE: Unity 2022.3.23 or above
273
+ case 2 :
274
+ parameters = new object [ ] { type , false } ;
275
+ break ;
276
+ //NOTE: Unity 2023.3.x or above
277
+ case 3 :
278
+ parameters = new object [ ] { type , null , false } ;
279
+ break ;
280
+ }
281
+
269
282
var result = getDrawerTypeForTypeMethod . Invoke ( null , parameters ) as Type ;
270
283
return result != null && typeof ( PropertyDrawer ) . IsAssignableFrom ( result ) ;
271
284
}
You can’t perform that action at this time.
0 commit comments