예제 #1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var color = (UnityEngine.Color)value;

            serializer.Serialize(writer, ColorUtil.ConvertToHexString(color));
        }
예제 #2
0
 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 {
     return(ColorUtil.ParseColorHexString((string)reader.Value));
 }