public void DescreaseValue(float decrement) { CancelInvoke("isNoMoreUnderAttack"); if (currentValue - decrement <= minValue) { currentValue = minValue; minimumReached = true; OnValueChanged(); return; } else { currentValue -= decrement; } if (hpBar != null) { hpBar.EnableBar(GetComponent <Blok>().name + " is under attack!"); } isUnderAttack = true; Invoke("isNoMoreUnderAttack", 5f); OnValueChanged(); }