Пример #1
0
 void BeforeSerialize(Block action)
 {
     if (action is MissingEvent)
     {
         return;
     }
     if (action != null)
     {
         System.Type type = action.GetType();
         typeName           = type.FullName;
         odinSerializedData = SerializerUtility.Serialize(action, out references);
     }
 }
Пример #2
0
 void AfterSerialize()
 {
     try {
         System.Type type = null;
         if (!string.IsNullOrEmpty(typeName))
         {
             type = TypeSerializer.Deserialize(typeName, false);
         }
         if (type != null)
         {
             block = SerializerUtility.DeserializeMigration(ref odinSerializedData, ref serializedData, ref references, type) as Block;
         }
         else if (eventType != EventType.Or)
         {
             block = new MissingEvent();
         }
     }
     catch (System.Exception ex) {
         Debug.LogException(ex);
     }
 }
Пример #3
0
 public static OdinSerializedData CreateFrom <T>(T value)
 {
     return(SerializerUtility.SerializeValue(value));
 }
Пример #4
0
 public object ToValue()
 {
     return(SerializerUtility.Deserialize(this));
 }