Skip to main content

Merchant.BuyFromPlayer

Declaration#

public void BuyFromPlayer(Inventory playerInventory, GDTKItem item)

Parameters#

NameDescription
playerInventoryPlayer's Inventory
itemItem to buy

Description#

Buy item from player (using Count Select settings)

Usage#

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

Declaration#

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

Parameters#

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

Description#

Buys a specific number of an item from player

Usage#

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