mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 20:12:23 +00:00
* 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
25 lines
736 B
C#
25 lines
736 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using MonoGame.Extended.Particles.Modifiers;
|
|
using MonoGame.Extended.Serialization;
|
|
|
|
namespace MonoGame.Extended.Particles.Serialization
|
|
{
|
|
public class ModifierJsonConverter : BaseTypeJsonConverter<IModifier>
|
|
{
|
|
public ModifierJsonConverter()
|
|
: base(GetSupportedTypes(), "Modifier")
|
|
{
|
|
}
|
|
|
|
private static IEnumerable<TypeInfo> GetSupportedTypes()
|
|
{
|
|
return typeof(IModifier)
|
|
.GetTypeInfo()
|
|
.Assembly
|
|
.DefinedTypes
|
|
.Where(type => typeof(IModifier).GetTypeInfo().IsAssignableFrom(type) && !type.IsAbstract);
|
|
}
|
|
}
|
|
} |