Ejemplo n.º 1
0
 private void Pickup(Health health, GameObject healFX, float percentToRestore, bool respawn,
                     float time)
 {
     Instantiate(healFX, health.transform);
     health.Heal(percentToRestore);
     base.Pickup(respawn, time);
 }
Ejemplo n.º 2
0
 private void DealMeleeDamage(Health targetHealth)
 {
     if (currentWeapon.GetDamage() > 0)
     {
         bool died = targetHealth.Damage(currentWeapon.GetDamage());
         if (died)
         {
             target = null;
         }
     }
     if (currentWeapon.GetDamage() < 0)
     {
         targetHealth.Heal(-currentWeapon.GetDamage());
     }
 }