Ejemplo n.º 1
0
 public void ActivatePotion()
 {
     if (FlowerLibrary.GetPotionAmount(_item.itemName) > 0)
     {
         if (_potionEffect.PotionEffectStart(FPSMovement.playerMovement))
         {
             EventManager.TriggerEvent(EventNameLibrary.DRINK_POTION, new EventParameter()
             {
                 boolParam     = false,
                 materialParam = _potionCameraEffect,
                 floatParam    = _potionDuration,
                 floatParam2   = _potionCameraEffectFadeTime
             });
             FlowerLibrary.IncrementPotion(_item.itemName, -1);
             UpdateUI();
         }
         else
         {
             Debug.Log("Potion already active");
         }
     }
     else
     {
         Debug.Log("Not enough of " + _item.itemName);
     }
 }
Ejemplo n.º 2
0
    public void AddPotion()
    {
        FlowerLibrary.IncrementPotion(_item.itemName, 1);
        Debug.Log("Adding one more " + _item.itemName + ", now there are " + FlowerLibrary.GetPotionAmount(_item.itemName));

        for (int i = 0; i < recipe.Count; i++)
        {
            FlowerLibrary.IncrementFlower(recipe[i].ingredient.itemName, -recipe[i].amount);
        }
        UpdateUI();
    }