[Bug] Serializable Fields looking for wrong Attribute
Posted: Mon Sep 11, 2017 10:35 am
Hi,
In ES3Reflection.GetSerializableFields and ES3Reflection.GetSerializableProperties, if safe=true a check is made to see if non-public fields/properties have the Serializable attribute:
Cheers
In ES3Reflection.GetSerializableFields and ES3Reflection.GetSerializableProperties, if safe=true a check is made to see if non-public fields/properties have the Serializable attribute:
if(safe) { // If the field is private, only serialize it if it's explicitly marked as serializable. if(!field.IsPublic && !Attribute.IsDefined(field, serializableAttributeType, true)) continue; }serializableAttributeType field looks like this:
public static readonly Type serializableAttributeType = typeof(System.SerializableAttribute);However, System.SerializableAttribute can only be placed on classes. I believe what this should actually be is UnityEngine.SerializeField.
Cheers