示例#1
0
 private void SetProperties(Item item)
 {
     if (item.IsConsumable())
     {
         Consumable toUse = (Consumable)item;
         if (toUse.HaveHealthValue())
         {
             SetProperty(health, toUse.GetHealth());
         }
         if (toUse.HaveHungerValue())
         {
             SetProperty(hunger, toUse.GetHunger());
         }
         if (toUse.HaveThirstValue())
         {
             SetProperty(thirst, toUse.GetThirst());
         }
         if (toUse.HaveEnergyValue())
         {
             SetProperty(energy, toUse.GetEnergy());
         }
     }
     else
     {
         Debug.Log("Sorry, item not usable");
     }
     itemProperties.SetActive(true);
 }