예제 #1
0
    public bool Activate()
    {
        if (isActivated)
        {
            return(true);
        }
        if (!arrowScript.PassTroughAllCheckPoints())
        {
            return(false);
        }

        this.time        = timerManager.Finish();
        this.isActivated = true;

        this.animator.SetTrigger("startend");

        string levelID  = Application.loadedLevel.ToString();
        float  bestTime = HighscoreManager.getHighscoreFloat(levelID);

        Debug.Log(bestTime + " " + this.time);
        if (bestTime > this.time)
        {
            this.text.text = "You beat the highscore !! press any key to continue.";

            HighscoreManager.setHighscore(this.time, levelID);
        }
        else
        {
            this.text.text = "Highscore is still better. press any key to continue.";
        }
        return(true);
    }