How Can To Make Code, When Timer Ends Direct Change To Scene Game Over.

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!”;
}
}
}

Please use code tags: Using code tags properly
And post in the right section: Unity Engine - Unity Discussions

3 Likes