summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Content.Pipeline/Animations/AstridAnimatorImporter.cs
blob: 855a0d334d092c901373e3ee8da1dfab4a62ff84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System.IO;
using System.Text.Json;
using Microsoft.Xna.Framework.Content.Pipeline;

namespace MonoGame.Extended.Content.Pipeline.Animations
{
    [ContentImporter(".aa", DefaultProcessor = "AstridAnimatorProcessor",
         DisplayName = "Astrid Animator Importer - MonoGame.Extended")]
    public class AstridAnimatorImporter : ContentImporter<ContentImporterResult<AstridAnimatorFile>>
    {
        public override ContentImporterResult<AstridAnimatorFile> Import(string filename, ContentImporterContext context)
        {
            var json = File.ReadAllText(filename);
            var data = JsonSerializer.Deserialize<AstridAnimatorFile>(json);
            return new ContentImporterResult<AstridAnimatorFile>(filename, data);
        }
    }
}