コード例 #1
0
    void Start()
    {
        string HtmlText = GetHtmlFromUri("http://google.com");

        if (HtmlText == "")
        {
            Debug.Log("Connection Not Found");
        }
        else
        {
            if (PlayerPrefs.HasKey("normalHighscore"))
            {
                Highscores.AddNewHighscore(PlayerPrefs.GetString("player"), PlayerPrefs.GetInt("normalHighscore"));
                PlayerPrefs.SetInt("normalHighscore", 0);
            }

            if (PlayerPrefs.HasKey("casualHighscore"))
            {
                CasualHighscores.AddNewHighscore(PlayerPrefs.GetString("player"), PlayerPrefs.GetInt("casualHighscore"));
                PlayerPrefs.SetInt("casualHighscore", 0);
            }

            if (PlayerPrefs.HasKey("tonyHighscore"))
            {
                TonysHighscores.AddNewHighscore(PlayerPrefs.GetString("player"), PlayerPrefs.GetInt("tonyHighscore"));
                PlayerPrefs.SetInt("tonyHighscore", 0);
            }
        }
    }
コード例 #2
0
    void Start()
    {
        for (int i = 0; i < highscoreFields.Length; i++)
        {
            highscoreFields[i].text = i + 1 + ". Fetching...";
        }

        highscoresManager = GetComponent <CasualHighscores>();
        StartCoroutine("RefreshHighscores");
    }
コード例 #3
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape) || Input.GetButton("Cancel"))
        {
            if (score > 0)
            {
                PlayerPrefs.SetInt("casualScore", score);
                CasualHighscores.AddNewHighscore(username, score);
            }

            /*  if (PlayerPrefs.HasKey("casualHighscore"))
             * {
             *    if (PlayerPrefs.GetInt("casualHigscore") < PlayerPrefs.GetInt("casualScore"))
             *        PlayerPrefs.SetInt("casualHighscore", PlayerPrefs.GetInt("casualScore"));
             * }
             * else
             *    PlayerPrefs.SetInt("casualHighscore", score);*/
        }
    }
コード例 #4
0
 void Awake()
 {
     highscoreDisplay = GetComponent <CasualDisplayHighscores>();
     instance         = this;
 }