I am trying to modify the ES3Type_GameObject script to make a property for each component individually instead of the default list.
My problem I believe is not getting the __type serialized like in the components list.
This is what I you get when serializing as a list. Notice the __type field.
Code: Select all
"components" : [
{
"__type" : "Transform",
"_ES3Ref" : "2870870594340260248",
"goID" : "753098917395072515",
"parent" : null,
Code: Select all
writer.WriteProperty($"component_{index}", component, ES3.ReferenceMode.ByRefAndValue);
Code: Select all
"component_1" : {
"_ES3Ref" : "2870870594340260248",
"goID" : "753098917395072515",
"parent" : null,
My question is how would I do that because LoadInto does not seem to work for me with what is serialized with my current code.
When the reader gets to the component_1 property it throws the following error
Code: Select all
FormatException: Expected ',' separating properties or '"' before property name, found '{'.
Code: Select all
ES3TypeMgr.GetOrCreateES3Type(type).ReadInto<Component>(reader, component);
Thanks,
CitrioN