Fix errors when installing in TriInspector in Unity <= 2020.1 (#143)

This commit is contained in:
Alexejhero 2023-11-05 09:00:43 +02:00 committed by GitHub
parent 0e23ca4a42
commit e825652e45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -1,8 +1,13 @@
using TriInspectorUnityInternalBridge; using TriInspectorUnityInternalBridge;
using UnityEditor; using UnityEditor;
using UnityEditor.AssetImporters;
using UnityEngine.UIElements; using UnityEngine.UIElements;
#if UNITY_2020_2_OR_NEWER
using UnityEditor.AssetImporters;
#else
using UnityEditor.Experimental.AssetImporters;
#endif
namespace TriInspector.Editors namespace TriInspector.Editors
{ {
[CanEditMultipleObjects] [CanEditMultipleObjects]

View File

@ -18,7 +18,7 @@ namespace TriInspector.Elements
private bool _expanded; private bool _expanded;
[Serializable] [Serializable]
public struct Props public new struct Props
{ {
public string title; public string title;
public TitleMode titleMode; public TitleMode titleMode;

View File

@ -63,7 +63,11 @@ namespace TriInspectorUnityInternalBridge
public static void DoAddButton(ReorderableList list, Object value) public static void DoAddButton(ReorderableList list, Object value)
{ {
#if UNITY_2020_2_OR_NEWER
defaultBehaviours.DoAddButton(list, value); defaultBehaviours.DoAddButton(list, value);
#else
defaultBehaviours.DoAddButton(list);
#endif
} }
} }
} }