recrownedathenaeum/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchImporter.cs

22 lines
743 B
C#
Raw Normal View History

using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using System.IO;
namespace RecrownedAthenaeum.Pipeline.NinePatch
{
[ContentImporter(".9p", DisplayName = "Nine Patch Importer", DefaultProcessor = "NinePatchProcessor")]
internal class NinePatchImporter : ContentImporter<NinePatchData>
{
public override NinePatchData Import(string filename, ContentImporterContext context)
{
NinePatchData data;
using (StreamReader stream = new StreamReader(filename))
{
data = JsonConvert.DeserializeObject<NinePatchData>(stream.ReadToEnd());
}
context.AddDependency(data.textureName);
return data;
}
}
}