| 93 | } |
| 94 | |
| 95 | void 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 | |
| 146 | void SceneObject::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) |
| 147 | { |
nothing calls this directly
no test coverage detected