my HEAD hurts and the SFX is TOO LOUD
This commit is contained in:
parent
a3321d361c
commit
d4ebf0ca61
41 changed files with 1465 additions and 123 deletions
|
|
@ -7,27 +7,14 @@ public class AbilityHotbarIcon : MonoBehaviour, IPointerEnterHandler, IPointerEx
|
|||
{
|
||||
public Transform cooldownBar;
|
||||
[SerializeField] private TextMeshProUGUI text;
|
||||
private bool onCooldown;
|
||||
private PlayerAbility thisAbility;
|
||||
[SerializeField] private FloatingAbilityInfo infoUI;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (onCooldown)
|
||||
if (thisAbility.currentCooldown > 0f || cooldownBar.localScale.x < 1f)
|
||||
{
|
||||
cooldownBar.localScale = new Vector3(Math.Clamp(1 - thisAbility.currentCooldown/thisAbility.cooldown, 0, 1), 1, 1);
|
||||
if (thisAbility.currentCooldown <= 0)
|
||||
{
|
||||
onCooldown = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateCooldown()
|
||||
{
|
||||
if (thisAbility.currentCooldown > 0)
|
||||
{
|
||||
onCooldown = true;
|
||||
cooldownBar.localScale = new Vector3(Math.Clamp(1f - thisAbility.currentCooldown/thisAbility.cooldown, 0f, 1f), 1f, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue