protected override void Write(ContentWriter output, LDtkLevel json)
 {
     try
     {
         ContentLogger.LogMessage($"Writting");
         output.Write(JsonSerializer.Serialize(json, LDtkWorld.SerializeOptions));
     }
     catch (Exception ex)
     {
         ContentLogger.LogMessage(ex.Message);
         ContentLogger.LogMessage(ex.StackTrace);
         throw;
     }
 }
    public override string Import(string filename, ContentImporterContext context)
    {
        try
        {
            ContentLogger.Logger = context.Logger;
            ContentLogger.LogMessage($"Importing '{filename}'");

            return(File.ReadAllText(Path.GetFullPath(filename)));
        }
        catch (Exception e)
        {
            context.Logger.LogImportantMessage(e.StackTrace);
            throw;
        }
    }
Example #3
0
    public override LDtkLevel Process(string input, ContentProcessorContext context)
    {
        try
        {
            ContentLogger.Logger = context.Logger;
            ContentLogger.LogMessage($"Processing");

            return(System.Text.Json.JsonSerializer.Deserialize <LDtkLevel>(input, LDtkWorld.SerializeOptions));
        }
        catch (Exception ex)
        {
            context.Logger.LogImportantMessage(ex.Message);
            throw;
        }
    }