示例#1
0
    //Download Scores - Don't need to call directly
    IEnumerator downloadHighscoresFromDatabace()
    {
        //Submit Score to databace
        WWW www = new WWW(webURL + publicCode + "/pipe/100");

        //Wait for Upload to be compleate.
        yield return(www);

        //Make sure there where no errors with upload
        if (string.IsNullOrEmpty(www.error))
        {
            //No Errors
            FormatHighscores(www.text);
            if (highscoreDisplay != null)
            {
                highscoreDisplay.OnHighscoresDownloaded(highscoresList);
            }
            else if (addHighScore != null)
            {
                addHighScore.OnHighscoresDownloaded(highscoresList);
            }
            else
            {
                print("ERROR: null script");
            }
        }
        else
        {
            //There where Errors
            print("There was an error with the Upload");
        }
    }
示例#2
0
    IEnumerator DownloadHighscoresFromDatabase()
    {
        WWW www = new WWW(webURL + publicCode + "/pipe/");

        yield return(www);

        if (string.IsNullOrEmpty(www.error))
        {
            FormatHighscores(www.text);
            highscoreDisplay.OnHighscoresDownloaded(highscoresList);
        }
        else
        {
            print("Error Downloading: " + www.error);
        }
    }
示例#3
0
    //--------------------------------- downloadLevelDB ----------------------------------------------
    // Connects to web URL and downloads highscores for specified level
    //------------------------------------------------------------------------------------------------
    IEnumerator downloadLevelDB(string publicKey)
    {
        WWW www = new WWW(URL + publicKey + "/pipe/");

        yield return(www);

        if (!string.IsNullOrEmpty(www.error))
        {
            Debug.Log("Error occured in high scores coroutine download: " + www.error);
        }
        else
        {
            formatHighScores(www.text);
            highScoresDisplay.OnHighscoresDownloaded(highScoresList);
        }
    }
    //Download Scores - Don't need to call directly
    IEnumerator downloadHighscoresFromDatabace()
    {
        //Submit Score to databace - Using the correct high score table.
        WWW www            = null;
        int leaderboardNum = PlayerPrefs.GetInt("leaderboardNum");

        if (leaderboardNum == 1)
        {
            www = new WWW(webURL + L1publicCode + "/pipe/10");
        }
        else if (leaderboardNum == 2)
        {
            www = new WWW(webURL + L2publicCode + "/pipe/10");
        }
        else
        {
            www = new WWW(webURL + L3publicCode + "/pipe/10");
        }

        //Wait for Upload to be compleate.
        yield return(www);

        //Make sure there where no errors with upload
        //If everything is good, tell the correct script that the scores have downloaded.
        if (string.IsNullOrEmpty(www.error))
        {
            //No Errors
            FormatHighscores(www.text);
            if (highscoreDisplay != null)
            {
                highscoreDisplay.OnHighscoresDownloaded(highscoresList);
            }
            else if (addHighScore != null)
            {
                addHighScore.OnHighscoresDownloaded(highscoresList);
            }
            else
            {
                print("ERROR: null script");
            }
        }
        else
        {
            //There where Errors
            print("There was an error with the Upload");
        }
    }