Ejemplo n.º 1
0
    IEnumerator RefreshHighscoresForA()
    {
        OnlineHighscores.DownloadHighscores();
        yield return(new WaitForSeconds(0.02f));

        addedHighscores = true;
    }
Ejemplo n.º 2
0
 IEnumerator RefreshHighscores()
 {
     while (true)
     {
         OnlineHighscores.DownloadHighscores();
         yield return(new WaitForSeconds(30));
     }
 }
Ejemplo n.º 3
0
    IEnumerator WaitUntillInternetIsOnOrOFF()
    {
        while (true)
        {
            yield return(new WaitForSeconds(2f));

            OnlineHighscores.DownloadHighscores();
        }
    }
Ejemplo n.º 4
0
    void Awake()
    {
        instance = this;

        if (SceneManager.GetActiveScene().name == "LeaderboardScene")
        {
            displayHighscores = GetComponent <DisplayHighscores>();
        }
    }
Ejemplo n.º 5
0
    void Update()
    {
        if (OnlineHighscores.canCommunicateWithServer == true && networkErrorText.IsActive())
        {
            StartCoroutine(WaitUntillInternetIsOnOrOFF());
            nameInputField.gameObject.GetComponent <Image>().color = new Color32(50, 50, 50, 255);
            networkErrorText.enabled = false;
            nameInputField.enabled   = true;
        }
        else if (OnlineHighscores.canCommunicateWithServer == false && !networkErrorText.IsActive() && settingsPanel.activeSelf == true)
        {
            StartCoroutine(WaitUntillInternetIsOnOrOFF());
            nameInputField.gameObject.GetComponent <Image>().color = new Color32(33, 32, 32, 255);
            networkErrorText.enabled = true;
            nameInputField.enabled   = false;
        }

        if (deletedHighscores == true)
        {
            for (int i = 0; i < OnlineHighscores.highscoreList.Length; i++)
            {
                if (OnlineHighscores.highscoreList[i].username == prevUsername)
                {
                    OnlineHighscores.DeleteHighscore(OnlineHighscores.highscoreList[i].username);
                }
            }

            StartCoroutine(RefreshHighscoresForA());
            deletedHighscores = false;
        }

        if (addedHighscores == true)
        {
            OnlineHighscores.AddNewHighscore(nameInputField.text, ScoreManage.highestScore);
            OnlineHighscores.DownloadHighscores();

            StaticContainer.username = nameInputField.text;
            SaveManager.SaveAllMainMenu();

            addedHighscores = false;
        }
    }
Ejemplo n.º 6
0
 public void UploadScores()
 {
     OnlineHighscores.AddNewHighscore(StaticContainer.username, ScoreManage.currentScore);
 }