[Bug] Serializable Fields looking for wrong Attribute

Discussion and help for Easy Save 3
Post Reply
Adam
Posts: 1
Joined: Thu Aug 31, 2017 2:12 pm

[Bug] Serializable Fields looking for wrong Attribute

Post 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
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: [Bug] Serializable Fields looking for wrong Attribute

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply