void Start()
    {
        previousCheck = Time.time;
        instance      = this;
        entryTemplate.gameObject.SetActive(false);
        _highScoreEntries = new List <playerScore>();

        fillData();

        for (int i = 0; i < _highScoreEntries.Count; i++)
        {
            for (int j = i + 1; j < _highScoreEntries.Count; j++)
            {
                if (_highScoreEntries[j].score > _highScoreEntries[i].score)
                {
                    playerScore temp = _highScoreEntries[i];
                    _highScoreEntries[i] = _highScoreEntries[j];
                    _highScoreEntries[j] = temp;
                }
            }
        }



        highScoreEntriesTransformList = new System.Collections.Generic.List <Transform>();
        foreach (playerScore entry in _highScoreEntries)
        {
            createHighScore(entry, entryContainer, highScoreEntriesTransformList);
        }
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     AttachArrow();
     if (scoreBoard == null)
     {
         scoreBoard = GameObject.FindGameObjectWithTag("ScoreBoard").GetComponent <scoreBoardScript>();            //get script component from scoreboard
     }
     scoreBoard.UpdateScore(targetScript.score);
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     if (player == null)
     {
         player = GameObject.FindGameObjectWithTag("MainCamera");
     }
     if (scoreBoard == null)
     {
         scoreBoard = GameObject.FindGameObjectWithTag("ScoreBoard").GetComponent <scoreBoardScript>();            //get script component from scoreboard
     }
 }