From e825652e45e1134650605f2880c7ba41b38c1d82 Mon Sep 17 00:00:00 2001 From: Alexejhero <32238504+Alexejhero@users.noreply.github.com> Date: Sun, 5 Nov 2023 09:00:43 +0200 Subject: [PATCH] Fix errors when installing in TriInspector in Unity <= 2020.1 (#143) --- Editor/Editors/TriScriptedImporterEditor.cs | 7 ++++++- Editor/Elements/TriBoxGroupElement.cs | 2 +- Unity.InternalAPIEditorBridge.012/ReorderableListProxy.cs | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Editor/Editors/TriScriptedImporterEditor.cs b/Editor/Editors/TriScriptedImporterEditor.cs index f71a07c..f5a977f 100644 --- a/Editor/Editors/TriScriptedImporterEditor.cs +++ b/Editor/Editors/TriScriptedImporterEditor.cs @@ -1,8 +1,13 @@ using TriInspectorUnityInternalBridge; using UnityEditor; -using UnityEditor.AssetImporters; using UnityEngine.UIElements; +#if UNITY_2020_2_OR_NEWER +using UnityEditor.AssetImporters; +#else +using UnityEditor.Experimental.AssetImporters; +#endif + namespace TriInspector.Editors { [CanEditMultipleObjects] diff --git a/Editor/Elements/TriBoxGroupElement.cs b/Editor/Elements/TriBoxGroupElement.cs index 9952856..0171153 100644 --- a/Editor/Elements/TriBoxGroupElement.cs +++ b/Editor/Elements/TriBoxGroupElement.cs @@ -18,7 +18,7 @@ namespace TriInspector.Elements private bool _expanded; [Serializable] - public struct Props + public new struct Props { public string title; public TitleMode titleMode; diff --git a/Unity.InternalAPIEditorBridge.012/ReorderableListProxy.cs b/Unity.InternalAPIEditorBridge.012/ReorderableListProxy.cs index 644c475..c7dd465 100644 --- a/Unity.InternalAPIEditorBridge.012/ReorderableListProxy.cs +++ b/Unity.InternalAPIEditorBridge.012/ReorderableListProxy.cs @@ -63,7 +63,11 @@ namespace TriInspectorUnityInternalBridge public static void DoAddButton(ReorderableList list, Object value) { +#if UNITY_2020_2_OR_NEWER defaultBehaviours.DoAddButton(list, value); +#else + defaultBehaviours.DoAddButton(list); +#endif } } } \ No newline at end of file