Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 3
0
 public static OdinSerializedData CreateFrom <T>(T value)
 {
     return(SerializerUtility.SerializeValue(value));
 }
Ejemplo n.º 4
0
 public object ToValue()
 {
     return(SerializerUtility.Deserialize(this));
 }