Reflection against protected fields not considered

Issue #42 resolved
Rainer Bernhardt created an issue

When sorting out private fields without the Serializable attribute, you might want to consider sorting out protected fields aswell

The check can be done with (field.IsPrivate || field.IsPublic == false)

if (!namespaceStr.StartsWith("UnityEngine", StringComparison.Ordinal) && (field.IsPrivate || field.IsPublic == false) && field.GetCustomAttributes(typeof(SerializeField), false).Length == 0)
{
    skipProperty = true;
 }

Comments (2)

  1. Log in to comment