From f5e155b60d8379631a35e48bb0971dc8882283ba Mon Sep 17 00:00:00 2001 From: miepzerino <o.skotnik@gmail.com> Date: Wed, 02 Apr 2025 17:38:41 +0000 Subject: [PATCH] #33 added depth meter to UI --- Assets/Scripts/UI/PlayerDisplay.cs | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/Assets/Scripts/UI/HealthDisplay.cs b/Assets/Scripts/UI/PlayerDisplay.cs similarity index 86% rename from Assets/Scripts/UI/HealthDisplay.cs rename to Assets/Scripts/UI/PlayerDisplay.cs index bfc9271..0875e21 100644 --- a/Assets/Scripts/UI/HealthDisplay.cs +++ b/Assets/Scripts/UI/PlayerDisplay.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)}"; } } -- Gitblit v1.9.3