From 36b288b23c5e9dd3baa1acb3d9f4b1a4758f26b6 Mon Sep 17 00:00:00 2001 From: ProtoSharkk Date: Mon, 21 Oct 2024 18:04:54 -0700 Subject: [PATCH] Attack cooldown bar below player (doesn't work yet) --- Assets/UI overlay/AttackCooldown.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/UI overlay/AttackCooldown.cs b/Assets/UI overlay/AttackCooldown.cs index 878b98e..ac218cc 100644 --- a/Assets/UI overlay/AttackCooldown.cs +++ b/Assets/UI overlay/AttackCooldown.cs @@ -3,15 +3,18 @@ using UnityEngine; public class AttackCooldown : MonoBehaviour { Teo player; - TMPro.TMP_Sprite bar; + UnityEngine.UI.Image bar; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent(); + bar = GetComponent(); } // Update is called once per frame void Update() { + Debug.Log(transform.position.x); + //bar.x=200*(Time.fixedTime-player.lastAttackTime)/player.attackCooldownSeconds; } }