You've already forked zumbi-game
add basic UI to player
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_Text statsDispaly;
|
||||
|
||||
private float time;
|
||||
private int kills;
|
||||
|
||||
public void IncrementKills()
|
||||
{
|
||||
kills++;
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
time += Time.fixedDeltaTime;
|
||||
statsDispaly.SetText($"Time: {time:F0}s | Kills: {kills}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user