AstridAnimatorImporter.cs 764 B

123456789101112131415161718
  1. using System.IO;
  2. using System.Text.Json;
  3. using Microsoft.Xna.Framework.Content.Pipeline;
  4. namespace MonoGame.Extended.Content.Pipeline.Animations
  5. {
  6. [ContentImporter(".aa", DefaultProcessor = "AstridAnimatorProcessor",
  7. DisplayName = "Astrid Animator Importer - MonoGame.Extended")]
  8. public class AstridAnimatorImporter : ContentImporter<ContentImporterResult<AstridAnimatorFile>>
  9. {
  10. public override ContentImporterResult<AstridAnimatorFile> Import(string filename, ContentImporterContext context)
  11. {
  12. var json = File.ReadAllText(filename);
  13. var data = JsonSerializer.Deserialize<AstridAnimatorFile>(json);
  14. return new ContentImporterResult<AstridAnimatorFile>(filename, data);
  15. }
  16. }
  17. }