void Update() { if (spell) { img.color = spell.CanUse() ? Color.white : Color.red; if (Input.GetKey(actionKey)) { PlayerEntityController.instance.UseSpell(spell); } if (spell.currentCooldown > 0f) { float prc = spell.currentCooldown / spell.cooldown; cooldown.fillAmount = prc; cooldown.enabled = true; } else { cooldown.enabled = false; } } }