private void Update() { cooldown = cooldownHandler.GetAbilityCooldown(ButtonId); if (cooldown <= 0.0f) { cooldown = initialCooldown; text.text = cooldown.ToString(); image.color = Color.white; text.color = Color.black; } else { cooldown -= Time.deltaTime; text.text = cooldown.ToString("F1"); } }