Page 1 of 1

[Bug] Serializable Fields looking for wrong Attribute

Posted: Mon Sep 11, 2017 10:35 am
by Adam
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:
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

Re: [Bug] Serializable Fields looking for wrong Attribute

Posted: Mon Sep 11, 2017 10:42 am
by Joel
Hi Adam,

Thanks for the bug report. This has already been fixed in the latest update which is currently on the Asset Store's approval queue.

All the best,
Joel