Exemple #1
0
    public void UseItem(int bagIndex)
    {
        if (RootContext.Instance.Player.IsShowBag)
        {
            return;
        }

        var item = bag.GetItem(bagIndex);

        if (item != null)
        {
            item.Use(this);
        }
        else
        {
            CurrentWeapon = null;
            ClearSlot(weaponSlo1);
        }

        RootContext.Instance.Player.SelectItem(bagIndex);
        UseItemIndex = bagIndex;
    }