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