JsonContentImporter.cs 603 B

123456789101112131415
  1. using System.IO;
  2. using Microsoft.Xna.Framework.Content.Pipeline;
  3. namespace MonoGame.Extended.Content.Pipeline.Json
  4. {
  5. [ContentImporter(".json", DefaultProcessor = nameof(JsonContentProcessor), DisplayName = "JSON Importer - MonoGame.Extended")]
  6. public class JsonContentImporter : ContentImporter<ContentImporterResult<string>>
  7. {
  8. public override ContentImporterResult<string> Import(string filename, ContentImporterContext context)
  9. {
  10. var json = File.ReadAllText(filename);
  11. return new ContentImporterResult<string>(filename, json);
  12. }
  13. }
  14. }