Skip to main content

Merchant.SellToPlayer

Declaration#

public void SellToPlayer(Inventory playerInventory, GDTKItem item)

Parameters#

NameDescription
playerInventoryPlayer's Inventory
itemItem to sell

Description#

Sells item to player (using Count Select settings)

Usage#

using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(Merchant target, Inventory other)    {        target.SellToPlayer(other, target.items[0]);    }
}

Declaration#

public void SellToPlayer(Inventory playerInventory, GDTKItem item, Int32 count)

Parameters#

NameDescription
playerInventoryPlayer's Inventory
itemItem to sell
countNumber of the item

Description#

Sells a specific number of an item to player

Usage#

using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(Merchant target, Inventory other)    {        target.SellToPlayer(other, target.items[0], 1);    }
}