Skip to content

Commit 9fd9c18

Browse files
Added changes requested
1 parent 0a43f4e commit 9fd9c18

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Editor/Drawers/RawReferenceDrawer.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,18 @@ protected override void OnPropertiesClicked()
110110

111111
private void AvoidDuplicateReferencesInArray()
112112
{
113-
if (!IsPropertyInArray(Property)) return;
114-
if (previousPropertyPath == null) return;
115-
if (previousPropertyPath == Property.propertyPath) return;
113+
if (!IsPropertyInArray(Property))
114+
return;
115+
if (previousPropertyPath == null)
116+
return;
117+
if (previousPropertyPath == Property.propertyPath)
118+
return;
116119

117-
var rawReferenceProperty = Property.FindPropertyRelative("rawReference");
118-
var currentReferenceValue = RawReferenceValue;
120+
SerializedProperty rawReferenceProperty = Property.FindPropertyRelative("rawReference");
121+
object currentReferenceValue = RawReferenceValue;
119122

120-
if (currentReferenceValue == null) return;
123+
if (currentReferenceValue == null)
124+
return;
121125

122126
if (previousReferenceValue == currentReferenceValue)
123127
{
@@ -135,9 +139,9 @@ private static bool IsPropertyInArray(SerializedProperty prop)
135139

136140
private static object CreateInstance(object source)
137141
{
138-
var instance = Activator.CreateInstance(source.GetType());
142+
object instance = Activator.CreateInstance(source.GetType());
139143
EditorUtility.CopySerializedManagedFieldsOnly(source, instance);
140144
return instance;
141145
}
142146
}
143-
}
147+
}

Editor/SerializableInterfacePropertyDrawer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private void Initialize(SerializedProperty property)
2626
activeDrawer = null;
2727
serializedProperty = property;
2828
genericType = GetGenericArgument();
29-
3029
Assert.IsNotNull(genericType, "Unable to find generic argument, are you doing some shady inheritance?");
3130
}
3231

@@ -106,4 +105,4 @@ GUIContent label
106105
}
107106
}
108107
}
109-
}
108+
}

0 commit comments

Comments
 (0)