Exemplo n.º 1
0
 private void Start()
 {
     maxScore = GameObject.Find("MaxScore").GetComponent <MaxScore>();
     effect   = GetComponent <AudioSource>();
     btnStart.onClick.AddListener(OnStart);
     btnExit.onClick.AddListener(OnExit);
     SetMaxScore(maxScore.GetMaxScore());
 }
    void SetResultText()
    {
        string message = string.Concat("Your record: ", maxScore.presentRecord);

        if (maxScore.GetMaxScore() != -1)
        {
            message = string.Concat(message, "\n max record: ", maxScore.GetMaxScore());
        }

        if (maxScore.presentRecord > maxScore.GetMaxScore())
        {
            message = string.Concat(message, "\n new max record! \n Congratulation!!");
            maxScore.BreakMaxRecord();
        }

        resultText.text = message;
    }