This is code but not change to scene game over. This is only show text game over when timer ends.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CountdownTimer : MonoBehaviour {
int countDownStartValue = 60;
public Text timerUI;
void Start () {
countDownTimer ();
}
void countDownTimer ()
{
if (countDownStartValue > 0)
{
TimeSpan spanTime = TimeSpan.FromSeconds(countDownStartValue);
timerUI.text = "Timer : " + spanTime.Minutes + " : " + spanTime.Seconds;
countDownStartValue–;
Invoke (“countDownTimer”, 1.0f);
}
else
{
timerUI.text = “GAME OVER!”;
}
}
}