healthSlider.cs 314 B

1234567891011121314151617
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using TMPro;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class healthSlider : MonoBehaviour
  7. {
  8. private TMP_Text txt;
  9. public Slider slider;
  10. private void Update() {
  11. txt.text = $"{slider.value}/{slider.maxValue}";
  12. }
  13. }