Thank You for help. Unfortunately this doesn’t work. My last attempts were very similar to your code.
Here is what I noticed so far:
- Because breakpoints doesn’t work in INLINE code I decided to override
void Serialize(FArchive &Ar);
for my class. - UE handles serializing TArray thanks to
friend FArchive& operator<<(FArchive& Ar, TArray& A)
in Engine\Source\Runtime\Core\Public\Containers\Array.h. In short this function is almost the same to what You wrote, so simply passing whole TArray should be fine, as long as UE knows how to serialize MyClass, if I’m not mistaken. Anyway I tested two options and ended with the same problem. - The most strange thing for me is why line “Ar << SB.moreTexts[ObjIndex]” uses
FArchive& FObjectAndNameAsStringProxyArchive::operator<<(class UObject*& Obj)
in Engine\Source\Runtime\CoreUObject\Private\Serialization\ArchiveUObject.cpp instead of my overloaded operator or overrided Serialize funciton. This is reason of saving data incorrectly.
Any ideas how to fix or omit this?