Hi all im a newbie of Unity (installed yesterday) and i’ve followed the tutorial “Roll a Ball” and create the minigame, i’ve added a in-game timer with this code. the question is, how i can stop timer when i collect all the pick ups?
using UnityEngine.UI;
using UnityEngine;
using System.Collections;
public class Timer : MonoBehaviour {
public Text timerText;
private float currentTime;
// Use this for initialization
void Start () {
currentTime = 0.0f;
}
// Update is called once per frame
void Update () {
currentTime += Time.deltaTime;
timerText.text = "Time: " + currentTime.ToString ();
}
}