public bool Set(string key, object value, Type type, DateTime absoluteExpiration) { if (string.IsNullOrWhiteSpace(key) || value == null) { return(false); } return(RedisHelper.Set(key, SerializerHandler.ToBytes(value, type), absoluteExpiration - DateTime.Now)); }
public static string ToJson(Stat item) => SerializerHandler.SerializeString(item);
public static Stat FromJson(string json) => SerializerHandler.DeserializeObj <Stat>(json);
public object Get(string key, Type type) { return(string.IsNullOrWhiteSpace(key) ? null : SerializerHandler.BytesToObject(RedisHelper.Get <byte[]>(key), type)); }
public void OnGameOverActive() { CheckBestScore(); //serialization call SerializerHandler.Save(SerializerHandler.DefaultDirectory, "Score.json", JsonUtility.ToJson(this)); }