Mini-Games-Game/Assets/Scripts/Timer.cs
Santi 3111305a83 WackAMole: Moles only give one point per, a timer has been added, comments
Timer: Created a universal timer

Colours: Improved Comments, cubes now randomly appear on start. When a cube is in a container it gets randomly teleported back
2024-06-07 14:37:52 +01:00

20 lines
419 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class Timer : MonoBehaviour
{
public float timeRemaining;
public TextMeshProUGUI timeText;
//* Universal code for timers
void Update()
{
if (timeRemaining > 0)
{
timeRemaining -= Time.deltaTime;
timeText.text = timeRemaining.ToString("F0");
}
}
}