Heal() 공개 메소드

public Heal ( float hp ) : void
hp float
리턴 void
예제 #1
0
 private void UseItem(float x, float y, bool saveLastDirection)
 {
     if (Inventory.instance.IsItemInHotBar())
     {
         string selecteditemType = Inventory.instance.GetTypeOfSelectedItem();
         if (selecteditemType == "MeleeWeapon")
         {
             playerCombat.MeleeAttack(x, y, saveLastDirection);
         }
         else if (selecteditemType == "ShootWapon")
         {
             playerCombat.Shoot(x, y, saveLastDirection);
         }
         else if (selecteditemType == "Potion")
         {
             playerProperties.Heal(Inventory.instance.GetSelectedItem().HP);
             Inventory.instance.DestroyCurrentItem(Inventory.instance.SelectedItemIndex);
         }
         else if (selecteditemType == "Bomb")
         {
             playerCombat.CastBomb();
         }
     }
 }