Files
MonoGame.Extended/Source/MonoGame.Extended.Particles/Serialization/ParticleJsonSerializer.cs
T
Dylan WilsonandGitHub 799b1edb06 Particles data driven (#388)
* yay, a start on data driven particles

* added data driven support for all particle profiles

* pretty much finished all of the particle serialization code

* resolved an inconsistency with the interpolators
2017-05-09 23:48:29 +10:00

28 lines
1.1 KiB
C#

using MonoGame.Extended.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace MonoGame.Extended.Particles.Serialization
{
public sealed class ParticleJsonSerializer : JsonSerializer
{
public ParticleJsonSerializer(ITextureRegionService textureRegionService)
{
Converters.Add(new Vector2JsonConverter());
Converters.Add(new Size2JsonConverter());
Converters.Add(new ColorJsonConverter());
Converters.Add(new TextureRegion2DJsonConverter(textureRegionService));
Converters.Add(new ProfileJsonConverter());
Converters.Add(new ModifierJsonConverter());
Converters.Add(new InterpolatorJsonConverter());
Converters.Add(new TimeSpanJsonConverter());
Converters.Add(new RangeJsonConverter<int>());
Converters.Add(new RangeJsonConverter<float>());
Converters.Add(new HslColorJsonConverter());
Converters.Add(new ModifierExecutionStrategyJsonConverter());
ContractResolver = new ShortNameJsonContractResolver();
Formatting = Formatting.Indented;
}
}
}