ZeroFormatter
ZeroFormatter copied to clipboard
Ignore formats removes next node
Imagine this code:
public class BufferView
{
[ZeroFormatter.IgnoreFormat] public int Width { get => TriangleCount; set => TriangleCount = value; }
[ZeroFormatter.IgnoreFormat] public int Height { get => VertexCount; set => VertexCount = value; }
[ZeroFormatter.Index(0)] public virtual byte Padding { get; set; } // IgnoreFormat for some reason removes the first index
[ZeroFormatter.Index(1)] public virtual long Start { get; set; }
[ZeroFormatter.Index(2)] public virtual long ByteLength { get; set; }
[ZeroFormatter.Index(3)] public virtual int TriangleCount { get; set; }
[ZeroFormatter.Index(4)] public virtual int VertexCount { get; set; }
}
This will result in Padding not being serialized - when searching for this property in the ZFC-generated file, it's no there. If the properties with IgnoreFormatAttribute are moved to the end, even the whole next ZeroFormattable class is removed.