Advertisement
sphinx2001

HUD.cs

Mar 23rd, 2021
881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class HUD : MonoBehaviour
  6. {
  7.     public TMPro.TextMeshProUGUI score;
  8.     public TMPro.TextMeshProUGUI timer;  
  9.  
  10.     void Update()
  11.     {
  12.         if(GameStorage.isPlay)
  13.             GameStorage.timer -= Time.deltaTime;
  14.         if(GameStorage.timer <= 0)
  15.         {
  16.             GameStorage.isPlay = false;
  17.         }
  18.         score.text = GameStorage.score.ToString();
  19.         timer.text = $"{(int)GameStorage.timer} sec";
  20.     }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement