Skip to content

Commit b7ff262

Browse files
committed
Merge branch 'develop'
2 parents d84f8ac + 074e06b commit b7ff262

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Assets/Editor Toolbox/Editor/Utilities/PropertyUtility.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ internal static bool HasModifedProperties(this SerializedProperty property)
2525
internal static string GetPropertyHashKey(this SerializedProperty property)
2626
{
2727
var hash = property.serializedObject.GetHashCode();
28+
#if UNITY_2019_2_OR_NEWER
2829
return property.propertyType != SerializedPropertyType.ManagedReference
2930
? $"{hash}.{property.propertyPath}"
3031
: $"{hash}.{property.propertyPath}.{property.managedReferenceFieldTypename}";
32+
#else
33+
return $"{hash}.{property.propertyPath}";
34+
#endif
3135
}
3236

3337
/// <summary>
@@ -36,9 +40,13 @@ internal static string GetPropertyHashKey(this SerializedProperty property)
3640
internal static string GetPropertyTypeKey(this SerializedProperty property)
3741
{
3842
var type = property.serializedObject.targetObject.GetType();
43+
#if UNITY_2019_2_OR_NEWER
3944
return property.propertyType != SerializedPropertyType.ManagedReference
4045
? $"{type}.{property.propertyPath}"
4146
: $"{type}.{property.propertyPath}.{property.managedReferenceFieldTypename}";
47+
#else
48+
return $"{type}.{property.propertyPath}";
49+
#endif
4250
}
4351

4452
/// <summary>
@@ -296,6 +304,7 @@ public static FieldInfo GetFieldInfoFromProperty(SerializedProperty property, ou
296304
{
297305
foundField = currentType.GetField(member, fieldFlags);
298306
//NOTE: [SerializeReference] detected? If so we need to check dynamically cached type
307+
#if UNITY_2019_2_OR_NEWER
299308
if (foundField == null)
300309
{
301310
var parent = property.GetParent();
@@ -305,6 +314,7 @@ public static FieldInfo GetFieldInfoFromProperty(SerializedProperty property, ou
305314
foundField = parentType.GetField(member, fieldFlags);
306315
}
307316
}
317+
#endif
308318
}
309319

310320
if (foundField == null)

Assets/Examples/Scripts/SampleBehaviour6.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public class ClassWithInterface1 : ClassWithInterfaceBase
2929
{
3030
[InLineEditor]
3131
public GameObject go;
32+
#if UNITY_2019_2_OR_NEWER
3233
[SerializeReference, ReferencePicker]
34+
#endif
3335
public Interface1 var1;
3436
}
3537

0 commit comments

Comments
 (0)