Ejemplo n.º 1
0
    void Start()
    {
        //Set the score text.
        GameInfo gameInfo = GameObject.Find("Viewbag").GetComponent <GameInfo>();
        int      score    = gameInfo.score;

        gameInfo.CheckHighScore(score);//See if this is the new high score.
        scoreInfo.text = "You caused $" + score + " in hospital fees";

        //Display best score.
        if (gameInfo.score == gameInfo.bestScore)
        {
            bestScoreText.text = "new best, congrats";
        }
        else
        {
            bestScoreText.text = "best: $" + gameInfo.bestScore;
        }
    }