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
This commit is contained in:
Dylan Wilson
2017-05-09 23:48:29 +10:00
committed by GitHub
parent 4bb614925c
commit 799b1edb06
38 changed files with 641 additions and 74 deletions
@@ -0,0 +1,24 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace MonoGame.Extended.Particles.Serialization
{
public class ModifierExecutionStrategyJsonConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
var value = JToken.Load(reader).ToObject<string>();
return ParticleModifierExecutionStrategy.Parse(value);
}
public override bool CanConvert(Type objectType)
{
return objectType == typeof(ParticleModifierExecutionStrategy);
}
}
}