public void Heal(float heal) { health += heal; if (health >= durabilities[type]) { health = durabilities[type]; UI_breakingBlocks.RemoveUI(this); } }
public void Damage(float damage) { if (durabilities[type] == -1) { return; } health -= damage; if (health <= 0) { UI_breakingBlocks.RemoveUI(this); PlayerMouvements.PlaySound(Sounds.Type.BlockBreak); SpawnDrop(); Remove(); } else if (health < durabilities[type]) { UI_breakingBlocks.AddUI(this); } }
public override void _Ready() { instance = this; }