Skip to main content

Merchant.AddItem

Declaration#

public virtual void AddItem(string itemId, Int32 count, Action<AddItemResult> callback)

Parameters#

NameDescription
itemIdId of the item to add
countNumber of the item to add
callbackCallback to invoke after action is completed with results

Description#

Add an item to the container

Usage#

using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(Merchant target)    {        target.AddItem(InventoryDatabase.instance.items[0].info.id, 1, AddItemResultCallback);    }
    private void AddItemResultCallback(AddItemResult result)    {        Debug.Log(result);    }}

Declaration#

public virtual void AddItem(GDTKItem item, Int32 count, Action<AddItemResult> callback)

Parameters#

NameDescription
itemReference of the item to add
countNumber of the item to add
callbackCallback to invoke after action is completed with results

Description#

Add an item to the container

Usage#

using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(Merchant target)    {        target.AddItem(InventoryDatabase.instance.items[0], 1, AddItemResultCallback);    }
    private void AddItemResultCallback(AddItemResult result)    {        Debug.Log(result);    }}