示例#1
0
 public void Heal(float heal)
 {
     health += heal;
     if (health >= durabilities[type])
     {
         health = durabilities[type];
         UI_breakingBlocks.RemoveUI(this);
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 public override void _Ready()
 {
     instance = this;
 }