Files
MonoGame.Extended/source/MonoGame.Extended.Content.Pipeline/TextureAtlases/TexturePackerJsonImporter.cs
T
Christopher WhitleyandGitHub d008b1bd41 Replace Newtonsoft.Json with System.Text.Json (#869)
* Converted to use `System.Text.Json`

* Remove Newtonsoft.Json Dependency
Newtonsoft.Json dependency has been removed in favor of System.Text.Json

* Treat MGFXO file as binary
2024-05-22 23:23:36 -04:00

19 lines
672 B
C#

using System.IO;
using System.Text.Json;
using Microsoft.Xna.Framework.Content.Pipeline;
using MonoGame.Extended.TextureAtlases;
namespace MonoGame.Extended.Content.Pipeline.TextureAtlases
{
[ContentImporter(".json", DefaultProcessor = "TexturePackerProcessor", DisplayName = "TexturePacker JSON Importer - MonoGame.Extended")]
public class TexturePackerJsonImporter : ContentImporter<TexturePackerFile>
{
public override TexturePackerFile Import(string filename, ContentImporterContext context)
{
var json = File.ReadAllText(filename);
return JsonSerializer.Deserialize<TexturePackerFile>(json);
}
}
}