Example #1
0
    private void OnTriggerEnter(Collider other)
    {
        float t = levelT.getTime();

        if (t < l0.getBestTime())
        {
            l0.setBestTime(t);
            Debug.Log("New Best Time: " + t);

            if (t < l0.getGoalTime())
            {
                gm.LevelComplete();
                Debug.Log("Level Beaten! Good Job");
            }
        }
        else
        {
            Debug.Log("THis Attempt: " + t);
            Debug.Log("Gotta go Faster!");
            Debug.Log("Current Best Time: " + l0.getBestTime());
        }

        gm.RespawnPlayer(other.gameObject);
        levelT.resetTimer();
    }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     t.text = "Time: " + levelT.getTime().ToString("F3") + "\n" + "Goal: " + l0.getGoalTime().ToString("F3") + "\n" + "Best:" + l0.getBestTime().ToString("F3");
 }