public override void Unserialize(GMDataReader reader, ListUnserialize before = null, ListUnserialize after = null, ListUnserializeElement elemReader = null) { // Read the element count and begin reading elements int count = reader.ReadInt32(); for (int i = 0; i < count; i++) { before?.Invoke(reader, i, Count); // Read the current element and add it to the list T elem; if (elemReader == null) { elem = reader.ReadPointerObject <T>(reader.ReadInt32(), true); } else { elem = (T)elemReader(reader, true); } Add(elem); after?.Invoke(reader, i, Count); } }
private static GMSerializable DoReadPointerObject(GMDataReader reader, bool notLast) { return(reader.ReadPointerObject <T>(reader.ReadInt32(), notLast)); }