I have written the following code for count down timer but its not working.
var seconds : int = 60;
function start()
{
InvokeRepeating("CountDown",1.0,1.0);
}
function CountDown()
{
if(--seconds ==0)
{
CancelInvoke("CountDown");
}
}
function OnGUI()
{
GUI.Label(Rect(10,45,100,55), "Counter: " + seconds);
}