// Writer public static void JsonSerializer(Jboy.JsonWriter writer, object instance) { writer.WriteNull(); /*var tex = (Texture2D)instance; writer.WriteObjectStart(); writer.WritePropertyName("width"); writer.WriteNumber(tex.width); writer.WritePropertyName("height"); writer.WriteNumber(tex.height); writer.WritePropertyName("data"); Jboy.Json.WriteObject(tex.EncodeToPNG(), writer); writer.WriteObjectEnd();*/ }
// Writer public static void JsonSerializer(Jboy.JsonWriter writer, object instance) { if(instance == null) { writer.WriteNull(); return; } var slot = (ItemSlot)instance; writer.WriteObjectStart(); // ID writer.WritePropertyName("item"); Jboy.Json.WriteObject(slot.item, writer); // Count writer.WritePropertyName("count"); writer.WriteNumber(slot.count); writer.WriteObjectEnd(); }