miepzerino
2025-04-02 f5e155b60d8379631a35e48bb0971dc8882283ba
Assets/Scripts/UI/PlayerDisplay.cs
File was renamed from Assets/Scripts/UI/HealthDisplay.cs
@@ -5,11 +5,12 @@
using UnityEngine;
using UnityEngine.UI;
public class HealthDisplay : MonoBehaviour
public class PlayerDisplay : MonoBehaviour
{
    private GameObject _playerGO;
    private Damageable playerDamage;
    public TextMeshProUGUI healthText;
    public TextMeshProUGUI depthMeterText;
    public Slider healthSlider;
    public GameObject PlayerGO
@@ -37,5 +38,6 @@
        healthText.text = "Health: " + playerDamage.Health;
        healthSlider.value = (float)playerDamage.Health / (float)playerDamage.MaxHealth;
        //healthImage.rectTransform.sizeDelta = new Vector2(originalRect.width * ((float)playerDamage.Health / (float)playerDamage.MaxHealth), originalRect.height);
        depthMeterText.text = $"Y: {Mathf.CeilToInt(_playerGO.transform.position.y)}";
    }
}