22 lines
702 B
C#
22 lines
702 B
C#
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
|||
|
using Newtonsoft.Json;
|
|||
|
using System.IO;
|
|||
|
|
|||
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|