예제 #1
0
    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();
    }
예제 #2
0
    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);
            }
        });
    }