// Gamewon screen
    public void GameWon()
    {
        triggered = true;
        string resultText = "CONGRATULATIONS!!!";

        //calculateScore(false);
        resultText             += string.Format("\n\nYou got a score of: {0:0}!!", DataScript.GetScore());
        resultText             += "\nYou would be an excellent " + sceneName + "!!!";
        resultTxt.text          = resultText;
        Time.timeScale          = 0;
        endOfGameCanvas.enabled = true;
    }
    // Gameover screen
    public void GameOver()
    {
        triggered = true;
        string resultText = "GAME OVER!!!";

        //calculateScore(true);
        resultText             += string.Format("\n\nYou got a score of: {0:0}!!", DataScript.GetScore());
        resultText             += "\nYou should hone your skills a bit more, but you will become a great " + sceneName + " one day!!!";
        resultTxt.text          = resultText;
        Time.timeScale          = 0;
        endOfGameCanvas.enabled = true;
    }
コード例 #3
0
 private void Update()
 {
     txtPlayer.text = "Player: " + DataScript.GetName() + " Score: " + DataScript.GetScore();
 }
 // loads the player name and score and shows it on the bottom left corner
 void Start()
 {
     score.text = "Player: " + DataScript.GetName() + " Score: " + DataScript.GetScore();
 }