Example #1
0
 public void OnObjectUse()
 {
     if (itemInfo.effect == "Heal")
     {
         if (global.currentHP == global.maxHP)
         {
             Debug.Log("user is at full health, need to find a way to display this");
         }
         else
         {
             global.currentHP += itemInfo.healing;
             if (global.currentHP >= global.maxHP)
             {
                 global.currentHP = global.maxHP;
             }
             currentHPText.text = "" + global.currentHP;
             GameObject toRemove = GameObject.Find(objectName);
             toRemove.SetActive(false);
             global.removeFromInventory(itemInfo);
         }
     }
     itemPopup.SetActive(false);
 }