Start of WiN/LOSE UI
finishing later today
This commit is contained in:
parent
e51417a4e5
commit
33d88bdfa7
8 changed files with 221 additions and 111 deletions
|
@ -1,36 +0,0 @@
|
|||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameUI : MonoBehaviour
|
||||
{
|
||||
[SerializeField] TextMeshProUGUI timer;
|
||||
private float time;
|
||||
public bool timerActive;
|
||||
|
||||
[SerializeField] TextMeshProUGUI units;
|
||||
private int enemiesLeft;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
time = 0;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (timerActive)
|
||||
{
|
||||
time += Time.deltaTime;
|
||||
}
|
||||
|
||||
TimeSpan displayedTime = TimeSpan.FromSeconds(time);
|
||||
|
||||
timer.text = displayedTime.Minutes.ToString() + displayedTime.Seconds.ToString();
|
||||
|
||||
|
||||
enemiesLeft = GlobalsVariable.AliveUnitsTeamA.Count;
|
||||
units.text = "Units Left: " + enemiesLeft.ToString();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue