public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { var color = (UnityEngine.Color)value; serializer.Serialize(writer, ColorUtil.ConvertToHexString(color)); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { return(ColorUtil.ParseColorHexString((string)reader.Value)); }