mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-25 08:22:15 +00:00
* 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
19 lines
672 B
C#
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);
|
|
}
|
|
}
|
|
}
|