Skip to content

Commit 1266b4c

Browse files
authored
Merge pull request #13 from Thundernerd/feature/collection_support
feature/collection support
2 parents 19e63e9 + c23b9bc commit 1266b4c

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

Editor/Builders/SceneItemBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public SceneItemBuilder(Type interfaceType, Scene? scene)
2424

2525
public AdvancedDropdownItem Build()
2626
{
27-
if (scene == null)
27+
if (scene == null || !scene.Value.IsValid())
2828
{
2929
return new AdvancedDropdownItem("Scene")
3030
{

Editor/SerializableInterfacePropertyDrawer.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections;
23
using TNRD.Drawers;
34
using UnityEditor;
45
using UnityEngine;
@@ -22,9 +23,10 @@ public override bool CanCacheInspectorGUI(SerializedProperty property)
2223

2324
private void Initialize(SerializedProperty property)
2425
{
25-
if (serializedProperty != null)
26+
if (serializedProperty == property)
2627
return;
2728

29+
activeDrawer = null;
2830
serializedProperty = property;
2931
genericType = GetGenericArgument();
3032
Assert.IsNotNull(genericType, "Unable to find generic argument, are you doing some shady inheritance?");
@@ -52,14 +54,26 @@ private Type GetGenericArgument()
5254

5355
while (type != null)
5456
{
57+
if (type.IsArray)
58+
type = type.GetElementType();
59+
60+
if (type == null)
61+
return null;
62+
5563
if (type.IsGenericType)
5664
{
57-
if (type.GetGenericTypeDefinition() == typeof(SerializableInterface<>))
65+
if (typeof(IEnumerable).IsAssignableFrom(type))
66+
{
67+
type = type.GetGenericArguments()[0];
68+
}
69+
else if (type.GetGenericTypeDefinition() == typeof(SerializableInterface<>))
5870
{
5971
return type.GetGenericArguments()[0];
6072
}
61-
62-
type = type.BaseType;
73+
else
74+
{
75+
type = type.BaseType;
76+
}
6377
}
6478
else
6579
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
{
127127
"assets": [
128128
"package.json",
129-
"package-lock.json",
129+
"!package-lock.json.meta",
130130
"CHANGELOG.md"
131131
],
132132
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"

0 commit comments

Comments
 (0)