Skip to content

Commit c96a1f7

Browse files
authored
Merge pull request #96 from immersivecognition/personal/jack/2021
editor helpers fix for 2021
2 parents 0a3fea6 + b707135 commit c96a1f7

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Assets/UXF/Scripts/Etc/Editor/EasyEventEditor.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,17 @@ private static void ApplyEventDrawerPatch(bool enableOverride)
335335

336336
public static void ApplyEventPropertyDrawerPatch(bool forceApply = false)
337337
{
338+
#if UNITY_2021_1_OR_NEWER
339+
// no need in Unity 2021
340+
#else
338341
EEESettings settings = GetEditorSettings();
339342

340343
if (!patchApplied || forceApply)
341344
{
342345
ApplyEventDrawerPatch(settings.overrideEventDrawer);
343346
patchApplied = true;
344347
}
348+
#endif
345349
}
346350

347351
public static EEESettings GetEditorSettings()
@@ -382,7 +386,7 @@ internal class SettingsGUIContent
382386
public static void DrawSettingsButtons(EasyEventEditorHandler.EEESettings settings)
383387
{
384388
EditorGUI.indentLevel += 1;
385-
389+
//
386390
settings.overrideEventDrawer = EditorGUILayout.ToggleLeft(enableToggleGuiContent, settings.overrideEventDrawer);
387391

388392
EditorGUI.BeginDisabledGroup(!settings.overrideEventDrawer);
@@ -403,6 +407,9 @@ public static void DrawSettingsButtons(EasyEventEditorHandler.EEESettings settin
403407
// Using the IMGUI method
404408
static class EasyEventEditorSettingsProvider
405409
{
410+
#if UNITY_2021_1_OR_NEWER
411+
// no need in Unity 2021
412+
#else
406413
[SettingsProvider]
407414
public static SettingsProvider CreateSettingsProvider()
408415
{
@@ -430,11 +437,15 @@ public static SettingsProvider CreateSettingsProvider()
430437

431438
return provider;
432439
}
440+
#endif
433441
}
434-
#else
435442
public class EasyEventEditorSettings : EditorWindow
436443
{
444+
#if UNITY_2021_1_OR_NEWER
445+
// no need in Unity 2021
446+
#else
437447
[MenuItem("Edit/Easy Event Editor Settings")]
448+
#endif
438449
static void Init()
439450
{
440451
EasyEventEditorSettings window = GetWindow<EasyEventEditorSettings>(false, "EEE Settings");
@@ -917,7 +928,7 @@ MethodInfo InvokeFindMethod(string functionName, object targetObject, UnityEvent
917928
findMethod = eventObject.GetType().GetMethod("FindMethod", BindingFlags.NonPublic | BindingFlags.Instance, null,
918929
new System.Type[] {
919930
typeof(string),
920-
#if UNITY_2020_1_OR_NEWER
931+
#if UNITY_2021_1_OR_NEWER
921932
typeof(System.Type),
922933
#else
923934
typeof(object),
@@ -936,7 +947,7 @@ MethodInfo InvokeFindMethod(string functionName, object targetObject, UnityEvent
936947
return null;
937948
}
938949

939-
#if UNITY_2020_1_OR_NEWER
950+
#if UNITY_2021_1_OR_NEWER
940951
return findMethod.Invoke(eventObject, new object[] {functionName, targetObject?.GetType(), listenerMode, argType }) as MethodInfo;
941952
#else
942953
return findMethod.Invoke(eventObject, new object[] {functionName, targetObject, listenerMode, argType }) as MethodInfo;

Assets/UXF/Scripts/Etc/ReorderableInspector/Editor/ReorderableArrayInspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ protected void DrawPropertySortableArray(SerializedProperty property)
785785
bool isStartProp = targetProp.propertyPath.StartsWith("m_");
786786
using (new EditorGUI.DisabledScope(isStartProp))
787787
{
788-
EditorGUILayout.PropertyField(targetProp, targetProp.isExpanded);
788+
EditorGUILayout.PropertyField(targetProp, true);
789789
}
790790
}
791791
}

0 commit comments

Comments
 (0)