public void LoadHighscore()
        {
            Dropdown tspDropdown = GameObject.Find("TspDropdown").GetComponent <Dropdown>();
            int      menuIndex   = tspDropdown.GetComponent <Dropdown>().value;
            List <Dropdown.OptionData> menuOptions = tspDropdown.GetComponent <Dropdown>().options;
            string tspName = menuOptions[menuIndex].text;

            PlayerPrefs.SetString("TspName", tspName);
#if UNITY_STANDALONE_WIN
            List <HighScoreEntry> scores = highScoreHandler.GetScores(PlayerPrefs.GetString("TspName"), HighScoreHandler.ORDER_TYPE_ASC);
            setScores(scores);
#endif


#if UNITY_WEBGL || UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_IPHONE
            StartCoroutine(highScoreHandler.ScoresWebGL());
            StartCoroutine(checkScores(highScoreHandler));
#endif
        }
Esempio n. 2
0
    void Start()
    {
        values = new List <float>();
        for (int i = 0; i < 3; i++)
        {
            values.Add(0f);
        }
        headline.text = "Statistics for " + PlayerPrefs.GetString("TspName");
        HighScoreHandler hsh = new HighScoreHandler();

#if UNITY_STANDALONE_WIN
        List <HighScoreEntry> scores = hsh.GetScores(PlayerPrefs.GetString("TspName"), HighScoreHandler.ORDER_TYPE_ASC, AntAlgorithmManager.GameName, -1);
        HandleScores(scores);
        MakeGraph();
#endif


#if UNITY_WEBGL || UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_IPHONE
        StartCoroutine(hsh.ScoresWebGL());
        StartCoroutine(checkScores(hsh));
#endif
    }