// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. #pragma once #include "Engine/Serialization/ISerializable.h" #include "ManagedCLR/MTypes.h" /// /// Managed objects serialization utilities. Helps with C# scripts saving to JSON or loading. /// class FLAXENGINE_API ManagedSerialization { public: #if USE_MONO /// /// Serializes managed object to JSON. /// /// The output stream. /// The object to serialize. static void Serialize(ISerializable::SerializeStream& stream, MonoObject* object); /// /// Serializes managed object difference to JSON. /// /// The output stream. /// The object to serialize. /// The reference object to serialize diff compared to it. static void SerializeDiff(ISerializable::SerializeStream& stream, MonoObject* object, MonoObject* other); /// /// Deserializes managed object from the JSON. /// /// The input stream. /// The object to deserialize. static void Deserialize(ISerializable::DeserializeStream& stream, MonoObject* object); /// /// Deserializes managed object from the JSON. /// /// The input data. /// The object to deserialize. static void Deserialize(const StringAnsiView& data, MonoObject* object); #endif };