@@ -335,13 +335,17 @@ private static void ApplyEventDrawerPatch(bool enableOverride)
335
335
336
336
public static void ApplyEventPropertyDrawerPatch ( bool forceApply = false )
337
337
{
338
+ #if UNITY_2021_1_OR_NEWER
339
+ // no need in Unity 2021
340
+ #else
338
341
EEESettings settings = GetEditorSettings ( ) ;
339
342
340
343
if ( ! patchApplied || forceApply )
341
344
{
342
345
ApplyEventDrawerPatch ( settings . overrideEventDrawer ) ;
343
346
patchApplied = true ;
344
347
}
348
+ #endif
345
349
}
346
350
347
351
public static EEESettings GetEditorSettings ( )
@@ -382,7 +386,7 @@ internal class SettingsGUIContent
382
386
public static void DrawSettingsButtons ( EasyEventEditorHandler . EEESettings settings )
383
387
{
384
388
EditorGUI . indentLevel += 1 ;
385
-
389
+ //
386
390
settings . overrideEventDrawer = EditorGUILayout . ToggleLeft ( enableToggleGuiContent , settings . overrideEventDrawer ) ;
387
391
388
392
EditorGUI . BeginDisabledGroup ( ! settings . overrideEventDrawer ) ;
@@ -403,6 +407,9 @@ public static void DrawSettingsButtons(EasyEventEditorHandler.EEESettings settin
403
407
// Using the IMGUI method
404
408
static class EasyEventEditorSettingsProvider
405
409
{
410
+ #if UNITY_2021_1_OR_NEWER
411
+ // no need in Unity 2021
412
+ #else
406
413
[ SettingsProvider ]
407
414
public static SettingsProvider CreateSettingsProvider ( )
408
415
{
@@ -430,11 +437,15 @@ public static SettingsProvider CreateSettingsProvider()
430
437
431
438
return provider ;
432
439
}
440
+ #endif
433
441
}
434
- #else
435
442
public class EasyEventEditorSettings : EditorWindow
436
443
{
444
+ #if UNITY_2021_1_OR_NEWER
445
+ // no need in Unity 2021
446
+ #else
437
447
[ MenuItem ( "Edit/Easy Event Editor Settings" ) ]
448
+ #endif
438
449
static void Init ( )
439
450
{
440
451
EasyEventEditorSettings window = GetWindow < EasyEventEditorSettings > ( false , "EEE Settings" ) ;
@@ -917,7 +928,7 @@ MethodInfo InvokeFindMethod(string functionName, object targetObject, UnityEvent
917
928
findMethod = eventObject . GetType ( ) . GetMethod ( "FindMethod" , BindingFlags . NonPublic | BindingFlags . Instance , null ,
918
929
new System . Type [ ] {
919
930
typeof ( string ) ,
920
- #if UNITY_2020_1_OR_NEWER
931
+ #if UNITY_2021_1_OR_NEWER
921
932
typeof ( System . Type ) ,
922
933
#else
923
934
typeof ( object ) ,
@@ -936,7 +947,7 @@ MethodInfo InvokeFindMethod(string functionName, object targetObject, UnityEvent
936
947
return null ;
937
948
}
938
949
939
- #if UNITY_2020_1_OR_NEWER
950
+ #if UNITY_2021_1_OR_NEWER
940
951
return findMethod . Invoke ( eventObject , new object [ ] { functionName , targetObject ? . GetType ( ) , listenerMode , argType } ) as MethodInfo ;
941
952
#else
942
953
return findMethod . Invoke ( eventObject , new object [ ] { functionName , targetObject , listenerMode , argType } ) as MethodInfo ;
0 commit comments