// Start is called before the first frame update
    void Start()
    {
        var scores = ScoresRepo.GetInstance().GetScores();
        int i      = 0;

        foreach (Score score in scores)
        {
            HighScoreLine line = Instantiate(highScoreLine, highScoreArea.transform, false);
            line.transform.localPosition += new Vector3(0, 100 - i * 50, 0);
            line.SetName(score.name);
            line.SetScore(score.score);
            i++;
            if (i > 5)
            {
                break;
            }
        }
    }
示例#2
0
 void Start()
 {
     _rb = GetComponent <Rigidbody2D>();
     _rb.gravityScale   = 0;
     _wind              = Wind.GetComponent <WindGenerator>();
     _bestAirResistance = Quaternion.Euler(new Vector3(0, 0, -21));
     _highScoreLine     = HighScore.GetComponent <HighScoreLine>();
     _lastPrefab        = 0;
     State              = playerState.Wait;
     if (_competitionManager == null)
     {
         _competitionManager = FindObjectOfType <CompetitionManager>();
         if (_competitionManager == null)
         {
             Debug.LogError("There is no _competition manager instatieted!");
         }
         _competition = _competitionManager as HotSeatCompetition;
         if (_competition != null)
         {
             _competition.ShowName();
         }
     }
 }