Crown Placement and Start of Game

Lisez pas mes commits svp T_T
This commit is contained in:
Kirabsol 2025-01-28 12:01:04 +01:00
parent c2af70eeb4
commit e805b7eb9c
13 changed files with 4399 additions and 3688 deletions

36
Assets/GameUI.cs Normal file
View file

@ -0,0 +1,36 @@
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();
}
}