Exemplo n.º 1
0
 public void OnBeforeSerialize()
 {
     for (int i = 0; i < GetallSerializableFields().Length; i++)
     {
         GetallSerializableFields()[i].SetValue(this, DeepSerial.DeserializeToProperType(((DeepSerial)GetallSerializableFields()[i].GetValue(this))));
     }
 }
Exemplo n.º 2
0
 public static DeepSerial DeserializeToProperType(DeepSerial deepSerial)
 {
     if (deepSerial == null)
     {
         return(null);
     }
     if (deepSerial.GetType() != deepSerial.DerivedClassType)
     {
         return((DeepSerial)JsonUtility.FromJson(deepSerial.serials, deepSerial.DerivedClassType));
     }
     else
     {
         return(deepSerial);
     }
 }