public IEnumerator LoadRestartGame() { Uniredis.Set(this, SystemInfo.deviceUniqueIdentifier + "LastScore", coins, (error, result) => { if (error == null) { Debug.Log("SET LASTSCORE SUCCESS"); } }); Uniredis.Get(this, SystemInfo.deviceUniqueIdentifier + "HighScore", (error, result) => { if (error == null) { if (int.Parse(result) < coins) { Uniredis.Set(this, SystemInfo.deviceUniqueIdentifier + "HighScore", coins, (error1, result1) => { if (error == null) { Debug.Log("SET HIGHSCORE SUCCESS"); } }); } } }); Uniredis.Get(this, "WorldRecord", (error, result) => { if (error == null) { if (int.Parse(result) < coins) { Uniredis.Set(this, "WorldRecord", coins, (error1, result1) => { if (error == null) { Debug.Log("SET WORLDRECORD SUCCESS"); } }); } } }); yield return(new WaitForSeconds(restartTimer)); RestartGame(); }
void Start() { Uniredis.Set(this, "Hello", "World", (error, result) => { if (error == null) { Debug.Log(result); } }); Uniredis.Get(this, "Hello", (error, result) => { if (error == null) { Debug.Log(result); } }); }