mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-03-25 11:14:40 -05:00
27 lines
676 B
C#
27 lines
676 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class Countdown : MonoBehaviour {
|
|
|
|
public TMP_Text countdown_text;
|
|
|
|
void Start() {
|
|
countdown_text.text = "Ready?";
|
|
StartCoroutine(BeginCoundown());
|
|
}
|
|
|
|
|
|
IEnumerator BeginCoundown() {
|
|
yield return new WaitForSecondsRealtime(1f);
|
|
countdown_text.text = "3";
|
|
yield return new WaitForSecondsRealtime(1f);
|
|
countdown_text.text = "2";
|
|
yield return new WaitForSecondsRealtime(1f);
|
|
countdown_text.text = "1";
|
|
yield return new WaitForSecondsRealtime(1f);
|
|
countdown_text.text = "Go!";
|
|
}
|
|
}
|