From a1198dcba0c40824c7d2e153d0467b131f422d40 Mon Sep 17 00:00:00 2001 From: Hopper262 Date: Sat, 13 Aug 2022 19:39:10 -0400 Subject: [PATCH] Add FSoftObjectProperty --- .../FProperties/FSoftObjectProperty.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 UnrealEngine.Gvas/FProperties/FSoftObjectProperty.cs diff --git a/UnrealEngine.Gvas/FProperties/FSoftObjectProperty.cs b/UnrealEngine.Gvas/FProperties/FSoftObjectProperty.cs new file mode 100644 index 0000000..03a542b --- /dev/null +++ b/UnrealEngine.Gvas/FProperties/FSoftObjectProperty.cs @@ -0,0 +1,25 @@ +namespace UnrealEngine.Gvas.FProperties; + +[OptionalGuid] +public class FSoftObjectProperty : FProperty +{ + public string? ObjectName { get; set; } + public int Unknown1 { get; set; } + + internal override void Read(BinaryReader reader, string? propertyName, long fieldLength, bool bodyOnly = false) + { + ObjectName = reader.ReadFString(); + Unknown1 = reader.ReadInt32(); + } + + internal override void Write(BinaryWriter writer, bool skipHeader) + { + writer.WriteFString(ObjectName!); + writer.Write(Unknown1); + } + + protected override IEnumerable SerializeContent() + { + yield return ObjectName ?? string.Empty; + } +}