To create a digital countdown timer, follow these steps:
- Import the provided _Scripts folder.
- In the Inspector window, remove the scripted component, ClockDigital, from the Text-clock GameObject. You can do this by choosing Remove Component from the 3-dot options menu icon for this component the Inspector window.
- In the Inspector window, add an instance of the CountdownTimer script class as a component by clicking the Add Component button, selecting Scripts, and choosing the CountdownTimer script class.
- Create a DigitalCountdown C# script class that contains the following code, and add an instance as a scripted component to the Text-clock GameObject:
using UnityEngine; using UnityEngine.UI; public class DigitalCountdown : MonoBehaviour { private Text textClock; private CountdownTimer countdownTimer; void Awake() { textClock = GetComponent<Text>(); countdownTimer...