public override T ReadFromUndoSnapshot(UndoSnapshotReader reader) { var obj = reader.ReadManagedReference() as T; builder.ReadUndo(obj, reader); return(obj); }
public override void ReadUndo(object target, UndoSnapshotReader reader) { var t = target as T; for (var i = firstWritableProperty; i < properties.Length; i++) { properties[i].DeserializeFromUndoBuilder(t, reader); } }
public override void DeserializeFromUndoBuilder(TOwner owner, UndoSnapshotReader reader) { var list = getter(owner); list.Clear(); var count = reader.reader.ReadInt32(); for (var i = 0; i < count; i++) { list.Add(new KeyValuePair <TKey, TValue>(KeySerializer.ReadFromUndoSnapshot(reader), ValueSerializer.ReadFromUndoSnapshot(reader))); } }
public override void DeserializeFromUndoBuilder(TOwner owner, UndoSnapshotReader reader) { var list = getter(owner); list.Clear(); var count = reader.reader.ReadInt32(); for (var i = 0; i < count; i++) { list.Add(reader.ReadOwnedReference <TElement>(owner)); } }
public override void ReadUndo(object target, UndoSnapshotReader reader) { var t = target as T; foreach (var property in properties) { if (property.type == PropertyType.Normal) { property.DeserializeFromUndoBuilder(t, reader); } } }
public abstract void ReadUndo(object target, UndoSnapshotReader reader);
public override float ReadFromUndoSnapshot(UndoSnapshotReader reader) => reader.reader.ReadSingle();
public override int ReadFromUndoSnapshot(UndoSnapshotReader reader) => reader.reader.ReadInt32();
public override T ReadFromUndoSnapshot(UndoSnapshotReader reader) { var val = reader.reader.ReadInt32(); return(Unsafe.As <int, T>(ref val)); }
public override T ReadFromUndoSnapshot(UndoSnapshotReader reader) => reader.ReadManagedReference() as T;
public override ulong ReadFromUndoSnapshot(UndoSnapshotReader reader) => reader.reader.ReadUInt64();
public override bool ReadFromUndoSnapshot(UndoSnapshotReader reader) => reader.reader.ReadBoolean();
public override void DeserializeFromUndoBuilder(TOwner owner, UndoSnapshotReader reader) => setter(owner, ValueSerializer.ReadFromUndoSnapshot(reader));
public abstract void DeserializeFromUndoBuilder(TOwner owner, UndoSnapshotReader reader);
public override void DeserializeFromUndoBuilder(TOwner owner, UndoSnapshotReader reader) { setter(owner, reader.ReadOwnedReference <TPropertyType>(owner)); }
public override void DeserializeFromUndoBuilder(TOwner owner, UndoSnapshotReader reader) { }