using Newtonsoft.Json; using System; using UnityEngine; namespace Assets.StreetLight.Serialization { public class Matrix4x4Converter : JsonConverter { public override bool CanConvert(Type objectType) { return objectType == typeof(Matrix4x4); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { return new Matrix4x4(); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { var matrix = (Matrix4x4)value; writer.WriteValue(matrix.ToString()); } } }