Exemplo n.º 1
0
    private void CreatePotion(float offset, bool isStamina)
    {
        Potion newPotion = Instantiate(_potionPrefab);

        newPotion.OnActivate        += OnItemChosen;
        newPotion.transform.position = _itemPosition.position + new Vector3(offset, 0, 0);
        newPotion.transform.SetParent(transform);
        if (isStamina)
        {
            newPotion.Initialize(_itemSprites[1], 0, 20, Debuff.NONE, "Stamina Potion");
        }
        else
        {
            newPotion.Initialize(_itemSprites[0], 20, 0, Debuff.NONE, "Health Potion");
        }
        _itemActions.Add(newPotion);
        newPotion.AddItem(2);
    }