Inventory.AddItem
#
Declarationpublic virtual void AddItem(string itemId, Int32 count, Action<AddItemResult> callback)
#
ParametersName | Description |
---|---|
itemId | Id of the item to add |
count | Number of the item to add |
callback | Callback to invoke after action is completed with results |
#
DescriptionAdd an item to the container
#
Usageusing NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
public void ExampleMethod(Inventory target) { target.AddItem(InventoryDatabase.instance.items[0].info.id, 1, AddItemResultCallback); }
private void AddItemResultCallback(AddItemResult result) { Debug.Log(result); }}
#
Declarationpublic virtual void AddItem(GDTKItem item, Int32 count, Action<AddItemResult> callback)
#
ParametersName | Description |
---|---|
item | Reference of the item to add |
count | Number of the item to add |
callback | Callback to invoke after action is completed with results |
#
DescriptionAdd an item to the container
#
Usageusing NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
public void ExampleMethod(Inventory target) { target.AddItem(InventoryDatabase.instance.items[0], 1, AddItemResultCallback); }
private void AddItemResultCallback(AddItemResult result) { Debug.Log(result); }}