recrownedathenaeum/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchImporter.cs

27 lines
818 B
C#

using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RecrownedAthenaeum.Pipeline.NinePatch
{
[ContentImporter(".9p", DisplayName = "Nine Patch Importer")]
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;
}
}
}