Пример #1
0
    private void Start()
    {
        entryContainer = transform.Find("highscoreEntryContainer");
        entryTemplate  = entryContainer.Find("highscoreEntryTemplate");

        entryTemplate.gameObject.SetActive(false);


        Highscores highscores = new Highscores();

        highscores.highscoreEntryList = ScoreSaver.LoadScore();

        Debug.Log(ScoreSaver.LoadScore().Count);

        // Sort entry list by Score
        for (int i = 0; i < highscores.highscoreEntryList.Count; i++)
        {
            for (int j = i + 1; j < highscores.highscoreEntryList.Count; j++)
            {
                if (highscores.highscoreEntryList[j].score > highscores.highscoreEntryList[i].score)
                {
                    // Swap
                    ScoreCointaner tmp = highscores.highscoreEntryList[i];
                    highscores.highscoreEntryList[i] = highscores.highscoreEntryList[j];
                    highscores.highscoreEntryList[j] = tmp;
                }
            }
        }

        highscoreEntryTransformList = new List <Transform>();
        foreach (ScoreCointaner highscoreEntry in highscores.highscoreEntryList)
        {
            CreateHighscoreEntryTransform(highscoreEntry, entryContainer, highscoreEntryTransformList);
        }
    }
Пример #2
0
    void Start()
    {
        sh = GameObject.Find("Shop").GetComponent <Shop>();
        //Hide Cursor
        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;
        //References
        rb  = GetComponent <Rigidbody>();
        cam = GetComponentInChildren <Camera>();
        ScoreData sD = ScoreSaver.LoadScore();

        sC.highScore = sD.highScore;
    }