MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Serialize

Method Serialize

Source/Engine/Level/SceneObject.cpp:95–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void SceneObject::Serialize(SerializeStream& stream, const void* otherObj)
96{
97 SERIALIZE_GET_OTHER_OBJ(SceneObject);
98
99 stream.JKEY("ID");
100 stream.Guid(_id);
101
102 if (other && HasPrefabLink())
103 {
104 stream.JKEY("PrefabID");
105 stream.Guid(_prefabID);
106
107 stream.JKEY("PrefabObjectID");
108 stream.Guid(_prefabObjectID);
109 }
110 else
111 {
112 stream.JKEY("TypeName");
113 stream.String(GetType().Fullname);
114 }
115
116 if (_parent)
117 {
118 stream.JKEY("ParentID");
119 stream.Guid(_parent->GetID());
120 }
121
122#if !COMPILE_WITHOUT_CSHARP
123 // Handle C# objects data serialization
124 if (EnumHasAnyFlags(Flags, ObjectFlags::IsManagedType))
125 {
126 stream.JKEY("V");
127 if (other)
128 {
129 ManagedSerialization::SerializeDiff(stream, GetOrCreateManagedInstance(), other->GetOrCreateManagedInstance());
130 }
131 else
132 {
133 ManagedSerialization::Serialize(stream, GetOrCreateManagedInstance());
134 }
135 }
136#endif
137
138 // Handle custom scripting objects data serialization
139 if (EnumHasAnyFlags(Flags, ObjectFlags::IsCustomScriptingType))
140 {
141 stream.JKEY("D");
142 _type.Module->SerializeObject(stream, this, other);
143 }
144}
145
146void SceneObject::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
147{

Callers

nothing calls this directly

Calls 9

GetTypeFunction · 0.85
EnumHasAnyFlagsFunction · 0.85
GuidMethod · 0.80
GetIDMethod · 0.80
SerializeObjectMethod · 0.80
SerializeFunction · 0.50
StringMethod · 0.45

Tested by

no test coverage detected