public static TypedSerializedData SaveWithType(object obj) { TypedSerializedData data = new TypedSerializedData(); data.data = VFXSerializer.Save(obj); data.type = obj.GetType().AssemblyQualifiedName; return(data); }
public static object LoadWithType(TypedSerializedData data, object oldValue) { if (!string.IsNullOrEmpty(data.data)) { System.Type type = SerializableType.GetType(data.type); if (type == null) { Debug.LogError("Can't find type " + data.type); return(null); } return(VFXSerializer.Load(type, data.data, oldValue)); } return(null); }