LifeManagerUI.cs 607 B

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. using System.Collections;
  3. public class LifeManagerUI : MonoBehaviour
  4. {
  5. [SerializeField]
  6. private UILabel _lblTimeToNexLife;
  7. [SerializeField]
  8. private UILabel _lblLivesCount;
  9. [SerializeField]
  10. private UIButton _uiButton;
  11. private float _lastTick = 0;
  12. internal void Start()
  13. {
  14. LifeManager.Reset();
  15. }
  16. public void Update()
  17. {
  18. if (_lastTick < Time.time)
  19. {
  20. _lastTick = Time.time + 1;
  21. _lblLivesCount.text = LifeManager.Lifes.ToString();
  22. _lblTimeToNexLife.text = "";
  23. }
  24. }
  25. }